diff options
author | Chris Robinson <[email protected]> | 2019-08-10 21:54:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-10 21:54:30 -0700 |
commit | 70058a8a8405a36c66235a56b482c4c0c7a46780 (patch) | |
tree | f0e574a0fc5f5227de699f57fbb4aad57ecde9ee /alc/helpers.cpp | |
parent | dca2365051e4697f5a1692252e9516398f746e0b (diff) |
Move the dynload decls and defs to common
Diffstat (limited to 'alc/helpers.cpp')
-rw-r--r-- | alc/helpers.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/alc/helpers.cpp b/alc/helpers.cpp index d1401c3c..b952c5ed 100644 --- a/alc/helpers.cpp +++ b/alc/helpers.cpp @@ -81,9 +81,6 @@ DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x #endif #endif /* AL_NO_UID_DEFS */ -#ifdef HAVE_DLFCN_H -#include <dlfcn.h> -#endif #ifdef HAVE_INTRIN_H #include <intrin.h> #endif @@ -454,21 +451,6 @@ const PathNamePair &GetProcBinary() } -void *LoadLib(const char *name) -{ - std::wstring wname{utf8_to_wstr(name)}; - return LoadLibraryW(wname.c_str()); -} -void CloseLib(void *handle) -{ FreeLibrary(static_cast<HMODULE>(handle)); } -void *GetSymbol(void *handle, const char *name) -{ - void *ret{reinterpret_cast<void*>(GetProcAddress(static_cast<HMODULE>(handle), name))}; - if(!ret) ERR("Failed to load %s\n", name); - return ret; -} - - void al_print(FILE *logfile, const char *fmt, ...) { al::vector<char> dynmsg; @@ -683,33 +665,6 @@ const PathNamePair &GetProcBinary() } -#ifdef HAVE_DLFCN_H - -void *LoadLib(const char *name) -{ - dlerror(); - void *handle{dlopen(name, RTLD_NOW)}; - const char *err{dlerror()}; - if(err) handle = nullptr; - return handle; -} -void CloseLib(void *handle) -{ dlclose(handle); } -void *GetSymbol(void *handle, const char *name) -{ - dlerror(); - void *sym{dlsym(handle, name)}; - const char *err{dlerror()}; - if(err) - { - WARN("Failed to load %s: %s\n", name, err); - sym = nullptr; - } - return sym; -} - -#endif /* HAVE_DLFCN_H */ - void al_print(FILE *logfile, const char *fmt, ...) { va_list ap; |