diff options
author | Guido van Rossum <guido@python.org> | 2000-10-25 22:07:45 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-10-25 22:07:45 +0000 |
commit | e7b761a0b762a744135249d25753ed586af25e0a (patch) | |
tree | e4156e9b624ad3a89d15ed278c560b70d4f3c95f /Python/dynload_shlib.c | |
parent | 17d1385443c34077087f34f054e797d66947eba8 (diff) | |
download | cpython-e7b761a0b762a744135249d25753ed586af25e0a.tar.gz |
Patch 102114, Bug 11725. On OpenBSD (but apparently not on the other
BSDs) you need a leading underscore in the dlsym() lookup name.
Diffstat (limited to 'Python/dynload_shlib.c')
-rw-r--r-- | Python/dynload_shlib.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index 2b0e74ee17..28f50b1f76 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -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 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, 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; |