Subversion Repositories Tewi

Rev

Rev 347 | Rev 359 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 347 Rev 349
Line 1... Line 1...
1
/* $Id: module.c 347 2024-10-15 16:33:28Z nishi $ */
1
/* $Id: module.c 349 2024-10-15 20:08:08Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "tw_module.h"
5
#include "tw_module.h"
6
 
6
 
Line 30... Line 30...
30
#ifdef __OS2__
30
#ifdef __OS2__
31
#define INCL_DOSMODULEMGR
31
#define INCL_DOSMODULEMGR
32
#define INCL_DOSERRORS
32
#define INCL_DOSERRORS
33
#include <os2.h>
33
#include <os2.h>
34
#elif defined(__NETWARE__)
34
#elif defined(__NETWARE__)
35
#include <dlfcn.h>
35
#include <nwadv.h>
-
 
36
#include <nwthread.h>
36
#else
37
#else
37
#include <windows.h>
38
#include <windows.h>
38
#include <direct.h>
39
#include <direct.h>
39
#endif
40
#endif
40
#else
41
#else
Line 56... Line 57...
56
	if(DosLoadModule(tmp, 512, path, &mod) != NO_ERROR) {
57
	if(DosLoadModule(tmp, 512, path, &mod) != NO_ERROR) {
57
		return NULL;
58
		return NULL;
58
	}
59
	}
59
	lib = (void*)mod;
60
	lib = (void*)mod;
60
#elif defined(__NETWARE__)
61
#elif defined(__NETWARE__)
-
 
62
	*hnd = FindNLMHandle(path);
61
	lib = dlopen(path, RTLD_LAZY);
63
	lib = (void*)hnd;
62
#else
64
#else
63
	lib = LoadLibraryA(path);
65
	lib = LoadLibraryA(path);
64
#endif
66
#endif
65
#else
67
#else
66
	lib = dlopen(path, RTLD_LAZY);
68
	lib = dlopen(path, RTLD_LAZY);
Line 82... Line 84...
82
		cm_log("Module", "OS/2 error %d", (int)rc);
84
		cm_log("Module", "OS/2 error %d", (int)rc);
83
		return NULL;
85
		return NULL;
84
	}
86
	}
85
	return ret;
87
	return ret;
86
#elif defined(__NETWARE__)
88
#elif defined(__NETWARE__)
87
	return dlsym(mod, sym);
89
	return ImportSymbol(*(unsigned int*)mod, sym);
88
#else
90
#else
89
	return GetProcAddress(mod, sym);
91
	return GetProcAddress(mod, sym);
90
#endif
92
#endif
91
#else
93
#else
92
	return dlsym(mod, sym);
94
	return dlsym(mod, sym);