Subversion Repositories Tewi

Rev

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

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