diff Python/dynload_shlib.c @ 15336:bbc991ab6d32 legacy-trunk

Patch 102114, Bug 11725. On OpenBSD (but apparently not on the other BSDs) you need a leading underscore in the dlsym() lookup name.
author Guido van Rossum <guido@python.org>
date Wed, 25 Oct 2000 22:07:45 +0000
parents 6e9ff060a728
children 3b9b8f2ddfe7
line wrap: on
line diff
--- a/Python/dynload_shlib.c	Wed Oct 25 21:58:20 2000 +0000
+++ b/Python/dynload_shlib.c	Wed Oct 25 22:07:45 2000 +0000
@@ -16,6 +16,12 @@
 #endif
 #endif
 
+#ifdef __OpenBSD__
+#define LEAD_UNDERSCORE "_"
+#else
+#define LEAD_UNDERSCORE ""
+#endif
+
 #ifndef RTLD_LAZY
 #define RTLD_LAZY 1
 #endif
@@ -54,8 +60,7 @@
 		pathname = pathbuf;
 	}
 
-	/* ### should there be a leading underscore for some platforms? */
-	sprintf(funcname, "init%.200s", shortname);
+	sprintf(funcname, LEAD_UNDERSCORE "init%.200s", shortname);
 
 	if (fp != NULL) {
 		int i;