blob: 70a7de2840e1beadb531ce9e37cdd908e376efab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
$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 <sys/types.h>
#include <sys/stat.h>
-#if defined(__NetBSD__) && (NetBSD < 199712)
+#if defined(__NetBSD__)
+#include <sys/param.h>
+#if (NetBSD < 199712)
#include <nlist.h>
#include <link.h>
#define dlerror() "error in dynamic linking"
@@ -15,6 +17,13 @@
#include <dlfcn.h>
#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;
|