1 /* Author:  Lisandro Dalcin
2  * Contact: dalcinl@gmail.com
3  */
4 
5 #ifndef PyMPI_DYNLOAD_H
6 #define PyMPI_DYNLOAD_H
7 
8 #if HAVE_DLFCN_H
9   #include <dlfcn.h>
10 #else
11   #if defined(__linux) || defined(__linux__)
12     #define RTLD_LAZY     0x00001
13     #define RTLD_NOW      0x00002
14     #define RTLD_LOCAL    0x00000
15     #define RTLD_GLOBAL   0x00100
16     #define RTLD_NOLOAD   0x00004
17     #define RTLD_NODELETE 0x01000
18     #define RTLD_DEEPBIND 0x00008
19   #elif defined(__sun) || defined(__sun__)
20     #define RTLD_LAZY     0x00001
21     #define RTLD_NOW      0x00002
22     #define RTLD_LOCAL    0x00000
23     #define RTLD_GLOBAL   0x00100
24     #define RTLD_NOLOAD   0x00004
25     #define RTLD_NODELETE 0x01000
26     #define RTLD_FIRST    0x02000
27   #elif defined(__APPLE__)
28     #define RTLD_LAZY     0x1
29     #define RTLD_NOW      0x2
30     #define RTLD_LOCAL    0x4
31     #define RTLD_GLOBAL   0x8
32     #define RTLD_NOLOAD   0x10
33     #define RTLD_NODELETE 0x80
34     #define RTLD_FIRST    0x100
35   #elif defined(__CYGWIN__)
36     #define RTLD_LAZY     1
37     #define RTLD_NOW      2
38     #define RTLD_LOCAL    0
39     #define RTLD_GLOBAL   4
40   #endif
41   #if defined(__cplusplus)
42   extern "C" {
43   #endif
44   extern void *dlopen(const char *, int);
45   extern void *dlsym(void *, const char *);
46   extern int   dlclose(void *);
47   extern char *dlerror(void);
48   #if defined(__cplusplus)
49   }
50   #endif
51 #endif
52 
53 #ifndef RTLD_LAZY
54 #define RTLD_LAZY 1
55 #endif
56 #ifndef RTLD_NOW
57 #define RTLD_NOW RTLD_LAZY
58 #endif
59 #ifndef RTLD_LOCAL
60 #define RTLD_LOCAL 0
61 #endif
62 #ifndef RTLD_GLOBAL
63 #define RTLD_GLOBAL RTLD_LOCAL
64 #endif
65 
66 #endif /* !PyMPI_DYNLOAD_H */
67 
68 /*
69   Local variables:
70   c-basic-offset: 2
71   indent-tabs-mode: nil
72   End:
73 */
74