$NetBSD: patch-aa,v 1.1.1.1 2002/01/16 18:40:48 drochner Exp $ --- Python/dynload_shlib.c.orig Mon Oct 16 23:49:29 2000 +++ Python/dynload_shlib.c Tue Dec 5 15:58:49 2000 @@ -6,7 +6,9 @@ #include #include -#if defined(__NetBSD__) && (NetBSD < 199712) +#if defined(__NetBSD__) +#include +#if (NetBSD < 199712) #include #include #define dlerror() "error in dynamic linking" @@ -15,6 +17,13 @@ #include #endif #endif +#endif /* __NetBSD__ */ + +#if (defined(__NetBSD__) || defined(__OpenBSD__)) && !defined(__ELF__) +#define LEAD_UNDERSCORE "_" +#else +#define LEAD_UNDERSCORE "" +#endif #ifndef RTLD_LAZY #define RTLD_LAZY 1 @@ -55,7 +64,7 @@ } /* ### 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;