diff options
Diffstat (limited to 'src/dlfcn.h')
-rw-r--r-- | src/dlfcn.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dlfcn.h b/src/dlfcn.h index 9ddbba3..164216f 100644 --- a/src/dlfcn.h +++ b/src/dlfcn.h | |||
@@ -28,9 +28,13 @@ | |||
28 | extern "C" { | 28 | extern "C" { |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #if defined(DLFCN_WIN32_SHARED) | ||
31 | #if defined(DLFCN_WIN32_EXPORTS) | 32 | #if defined(DLFCN_WIN32_EXPORTS) |
32 | # define DLFCN_EXPORT __declspec(dllexport) | 33 | # define DLFCN_EXPORT __declspec(dllexport) |
33 | #else | 34 | #else |
35 | # define DLFCN_EXPORT __declspec(dllimport) | ||
36 | #endif | ||
37 | #else | ||
34 | # define DLFCN_EXPORT | 38 | # define DLFCN_EXPORT |
35 | #endif | 39 | #endif |
36 | 40 | ||
@@ -59,6 +63,15 @@ extern "C" { | |||
59 | /* Specifies the next object after this one that defines name. */ | 63 | /* Specifies the next object after this one that defines name. */ |
60 | #define RTLD_NEXT ((void *)-1) | 64 | #define RTLD_NEXT ((void *)-1) |
61 | 65 | ||
66 | /* Structure filled in by dladdr() */ | ||
67 | typedef struct dl_info | ||
68 | { | ||
69 | const char *dli_fname; /* Filename of defining object (thread unsafe and reused on every call to dladdr) */ | ||
70 | void *dli_fbase; /* Load address of that object */ | ||
71 | const char *dli_sname; /* Name of nearest lower symbol */ | ||
72 | void *dli_saddr; /* Exact value of nearest symbol */ | ||
73 | } Dl_info; | ||
74 | |||
62 | /* Open a symbol table handle. */ | 75 | /* Open a symbol table handle. */ |
63 | DLFCN_EXPORT void *dlopen(const char *file, int mode); | 76 | DLFCN_EXPORT void *dlopen(const char *file, int mode); |
64 | 77 | ||
@@ -71,6 +84,9 @@ DLFCN_EXPORT void *dlsym(void *handle, const char *name); | |||
71 | /* Get diagnostic information. */ | 84 | /* Get diagnostic information. */ |
72 | DLFCN_EXPORT char *dlerror(void); | 85 | DLFCN_EXPORT char *dlerror(void); |
73 | 86 | ||
87 | /* Translate address to symbolic information (no POSIX standard) */ | ||
88 | DLFCN_EXPORT int dladdr(void *addr, Dl_info *info); | ||
89 | |||
74 | #ifdef __cplusplus | 90 | #ifdef __cplusplus |
75 | } | 91 | } |
76 | #endif | 92 | #endif |