51 |
#elif defined(__NETWARE__) |
#elif defined(__NETWARE__) |
52 |
unsigned int* hnd = malloc(sizeof(*hnd)); |
unsigned int* hnd = malloc(sizeof(*hnd)); |
53 |
#endif |
#endif |
54 |
|
#ifndef WINCE |
55 |
chdir(config.server_root); |
chdir(config.server_root); |
56 |
|
#endif |
57 |
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) |
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) |
58 |
#ifdef __OS2__ |
#ifdef __OS2__ |
59 |
if(DosLoadModule(tmp, 512, path, &mod) != NO_ERROR) { |
if(DosLoadModule(tmp, 512, path, &mod) != NO_ERROR) { |
68 |
} |
} |
69 |
lib = (void*)hnd; |
lib = (void*)hnd; |
70 |
#else |
#else |
71 |
lib = LoadLibraryA(path); |
lib = LoadLibrary(path); |
72 |
#endif |
#endif |
73 |
#else |
#else |
74 |
lib = dlopen(path, RTLD_LAZY); |
lib = dlopen(path, RTLD_LAZY); |
76 |
if(lib == NULL) { |
if(lib == NULL) { |
77 |
cm_log("Module", "Could not load %s", path); |
cm_log("Module", "Could not load %s", path); |
78 |
} |
} |
79 |
|
#ifndef WINCE |
80 |
chdir(p); |
chdir(p); |
81 |
|
#endif |
82 |
free(p); |
free(p); |
83 |
return lib; |
return lib; |
84 |
} |
} |
95 |
return ret; |
return ret; |
96 |
#elif defined(__NETWARE__) |
#elif defined(__NETWARE__) |
97 |
return ImportSymbol(*(unsigned int*)mod, sym); |
return ImportSymbol(*(unsigned int*)mod, sym); |
98 |
|
#elif defined(WINCE) |
99 |
|
return GetProcAddressW(mod, sym); |
100 |
#else |
#else |
101 |
return GetProcAddress(mod, sym); |
return GetProcAddress(mod, sym); |
102 |
#endif |
#endif |