From 8ce82a873ac1667ee4cbdc83b812a91e4ada0edf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Dec 2024 14:30:13 -0500 Subject: Add dylib abstraction to isolate platform-specific code --- src/lilv_internal.h | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'src/lilv_internal.h') diff --git a/src/lilv_internal.h b/src/lilv_internal.h index 3693f8a..6dc47ee 100644 --- a/src/lilv_internal.h +++ b/src/lilv_internal.h @@ -23,20 +23,11 @@ extern "C" { #ifdef _WIN32 # include # include -# define dlopen(path, flags) LoadLibrary(path) -# define dlclose(lib) FreeLibrary((HMODULE)lib) # ifdef _MSC_VER # ifndef snprintf # define snprintf _snprintf # endif # endif -static inline const char* -dlerror(void) -{ - return "Unknown error"; -} -#else -# include #endif #ifdef LILV_DYN_MANIFEST @@ -399,21 +390,6 @@ lilv_find_free_path(const char* in_path, bool (*exists)(const char*, const void*), const void* user_data); -typedef void (*LilvVoidFunc)(void); - -/** dlsym wrapper to return a function pointer (without annoying warning) */ -static inline LilvVoidFunc -lilv_dlfunc(void* handle, const char* symbol) -{ -#ifdef _WIN32 - return (LilvVoidFunc)GetProcAddress((HMODULE)handle, symbol); -#else - typedef LilvVoidFunc (*VoidFuncGetter)(void*, const char*); - VoidFuncGetter dlfunc = (VoidFuncGetter)dlsym; - return dlfunc(handle, symbol); -#endif -} - #ifdef LILV_DYN_MANIFEST static const LV2_Feature* const dman_features = {NULL}; -- cgit v1.2.1