Changeset 312 in Main for trunk/Server/module.c


Ignore:
Timestamp:
Oct 14, 2024, 3:17:37 AM (5 weeks ago)
Author:
Nishi
Message:

works on os2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Server/module.c

    r219 r312  
    2828
    2929#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
     30#ifdef __OS2__
     31#define INCL_DOSMODULEMGR
     32#include <os2.h>
     33#else
    3034#include <windows.h>
    3135#include <direct.h>
     36#endif
    3237#else
    3338#include <dlfcn.h>
     
    3742        char* p = getcwd(NULL, 0);
    3843        void* lib;
     44        char tmp[512];
     45        unsigned long l;
    3946        chdir(config.server_root);
    4047#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
     48#ifdef __OS2__
     49        lib = NULL;
     50        l = (unsigned long)lib;
     51        DosLoadModule(tmp, 512, path, &l);
     52#else
    4153        lib = LoadLibraryA(path);
     54#endif
    4255#else
    4356        lib = dlopen(path, RTLD_LAZY);
     
    5366void* tw_module_symbol(void* mod, const char* sym) {
    5467#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
     68#ifdef __OS2__
     69        void* ret;
     70        DosQueryProcAddr((unsigned long)mod, 0, sym, (PFN*)&ret);
     71        return ret;
     72#else
    5573        return GetProcAddress(mod, sym);
     74#endif
    5675#else
    5776        return dlsym(mod, sym);
Note: See TracChangeset for help on using the changeset viewer.