Annotation of sbbs/src/xpdev/xp_dl.h, revision 1.1.1.1

1.1       root        1: #ifndef _XP_DL_H_
                      2: #define _XP_DL_H_
                      3: 
                      4: #include "wrapdll.h"
                      5: 
                      6: #ifndef STATIC_LINK
                      7: #if defined(__unix__)
                      8:        #include <dlfcn.h>
                      9: 
                     10:        typedef void * dll_handle;
                     11:        DLLEXPORT dll_handle DLLCALL xp_dlopen(const char **name, int mode, int major);
                     12:        #define xp_dlsym(handle, name)                          dlsym(handle, #name)
                     13:        #define xp_dlclose(handle)                                      dlclose(handle)
                     14: #elif defined(_WIN32)
                     15:        #include <Windows.h>
                     16: 
                     17:        typedef HMODULE dll_handle;
                     18:        DLLEXPORT dll_handle DLLCALL xp_dlopen(const char **name, int mode, int major);
                     19:        #define xp_dlsym(handle, name)                          ((void *)GetProcAddress(handle, #name))
                     20:        #define xp_dlclose(handle)                                      (FreeLibrary(handle)?0:-1)
                     21: 
                     22:        /* Unused values for *nix compatability */
                     23:        enum {
                     24:                 RTLD_LAZY
                     25:                ,RTLD_NOW
                     26:                ,RTLD_GLOBAL
                     27:                ,RTLD_LOCAL
                     28:                ,RTLD_TRACE
                     29:        };
                     30: #endif
                     31: #else
                     32:        typedef void* dll_handle;
                     33: 
                     34:        #define xp_dlopen(name, mode, major)    (name)
                     35:        #define xp_dlsym(handle, name)                  (name)
                     36:        #define xp_dlclose(handle)                              (0)
                     37: #endif
                     38: 
                     39: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.