--- Server/module.c 2024/10/17 09:53:39 1.1 +++ Server/module.c 2024/11/19 07:55:13 1.3 @@ -1,4 +1,4 @@ -/* $Id: module.c,v 1.1 2024/10/17 09:53:39 nishi Exp $ */ +/* $Id: module.c,v 1.3 2024/11/19 07:55:13 nishi Exp $ */ #define SOURCE @@ -17,7 +17,7 @@ extern struct tw_config config; -#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(__NeXT__) || defined(__DOS__) +#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(__NeXT__) || defined(__DOS__) || defined(__amiga__) void* tw_module_load(const char* path) { return NULL; } void* tw_module_symbol(void* mod, const char* sym) { return NULL; } @@ -51,7 +51,9 @@ void* tw_module_load(const char* path) { #elif defined(__NETWARE__) unsigned int* hnd = malloc(sizeof(*hnd)); #endif +#ifndef WINCE chdir(config.server_root); +#endif #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) #ifdef __OS2__ if(DosLoadModule(tmp, 512, path, &mod) != NO_ERROR) { @@ -66,7 +68,7 @@ void* tw_module_load(const char* path) { } lib = (void*)hnd; #else - lib = LoadLibraryA(path); + lib = LoadLibrary(path); #endif #else lib = dlopen(path, RTLD_LAZY); @@ -74,7 +76,9 @@ void* tw_module_load(const char* path) { if(lib == NULL) { cm_log("Module", "Could not load %s", path); } +#ifndef WINCE chdir(p); +#endif free(p); return lib; } @@ -91,6 +95,8 @@ void* tw_module_symbol(void* mod, const return ret; #elif defined(__NETWARE__) return ImportSymbol(*(unsigned int*)mod, sym); +#elif defined(WINCE) + return GetProcAddressW(mod, sym); #else return GetProcAddress(mod, sym); #endif