From 9e9cb02a6a0615d04a16693c36b4898c2be9cc32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Thu, 2 Nov 2023 10:59:58 +0100 Subject: [PATCH] sync fwk --- engine/split/v4k_dll.c | 29 ----------------------------- engine/split/v4k_dll.h | 12 ------------ 2 files changed, 41 deletions(-) delete mode 100644 engine/split/v4k_dll.c delete mode 100644 engine/split/v4k_dll.h diff --git a/engine/split/v4k_dll.c b/engine/split/v4k_dll.c deleted file mode 100644 index fe438d8..0000000 --- a/engine/split/v4k_dll.c +++ /dev/null @@ -1,29 +0,0 @@ -#if is(win32) -# include -# define dlopen(name,mode) (void*)( (name) ? LoadLibraryA(name) : GetModuleHandle(NULL)) -# define dlsym(handle,symbol) GetProcAddress((HMODULE)handle, symbol ) -# define dlclose(handle) 0 -#else -# include -#endif - -void* dll(const char *filename, const char *symbol) { -/* - char *buf, *base = file_name(filename); - if( file_exists(buf = va("%s", base)) || - file_exists(buf = va("%s.dll", base)) || - file_exists(buf = va("%s.so", base)) || - file_exists(buf = va("lib%s.so", base)) || - file_exists(buf = va("%s.dylib", base)) ) { - filename = buf; - } -*/ - void *dll = dlopen(filename, RTLD_NOW | RTLD_LOCAL); - dll = dll ? dlsym(dll, symbol) : 0; - return dll; -} - -#if 0 // demo: cl demo.c /LD && REM dll -EXPORT int add2(int a, int b) { return a + b; } -int main() { int (*adder)() = dll("demo.dll", "add2"); printf("%d\n", adder(2,3)); } -#endif diff --git a/engine/split/v4k_dll.h b/engine/split/v4k_dll.h deleted file mode 100644 index a4a0064..0000000 --- a/engine/split/v4k_dll.h +++ /dev/null @@ -1,12 +0,0 @@ -// dll utils -// - rlyeh, public domain - -/// !!! `filename` must contain extension -/// load dynamic library `file` and search for `symbol` -/// return: NULL if not found, found symbol otherwise. -/// filename: path to dynamic library file. must contain extension. -/// symbol: symbol name. must not be NULL. -/// see: dlopen^, dlclose^ -/// > bool (*plugin_init)(void) = dll("plugin.dll", "init"); -/// > assert(plugin_init()); -API void* dll(const char *filename, const char *symbol);