diff options
Diffstat (limited to 'zen/dll.h')
-rw-r--r-- | zen/dll.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -8,12 +8,12 @@ #define DLLLOADER_H_INCLUDED #include <memory> -#ifdef FFS_WIN +#ifdef ZEN_WIN #include <string> #include "scope_guard.h" #include "win.h" //includes "windows.h" -#elif defined FFS_LINUX || defined FFS_MAC +#elif defined ZEN_LINUX || defined ZEN_MAC #include <dlfcn.h> #endif @@ -40,11 +40,11 @@ class DllFun public: DllFun() : fun(nullptr) {} -#ifdef FFS_WIN +#ifdef ZEN_WIN DllFun(const wchar_t* libraryName, const char* functionName) : hLibRef(::LoadLibrary(libraryName), ::FreeLibrary), fun(hLibRef ? reinterpret_cast<Func>(::GetProcAddress(static_cast<HMODULE>(hLibRef.get()), functionName)) : nullptr) {} -#elif defined FFS_LINUX || defined FFS_MAC +#elif defined ZEN_LINUX || defined ZEN_MAC DllFun(const char* libraryName, const char* functionName) : hLibRef(::dlopen(libraryName, RTLD_LAZY), ::dlclose), fun(hLibRef ? reinterpret_cast<Func>(::dlsym(hLibRef.get(), functionName)) : nullptr) {} @@ -57,7 +57,7 @@ private: }; -#ifdef FFS_WIN +#ifdef ZEN_WIN //if the dll is already part of the process space, e.g. "kernel32.dll" or "shell32.dll", we can use a faster variant: //NOTE: since the lifetime of the referenced library is *not* controlled, this is safe to use only for permanently loaded libraries like these! template <class Func> @@ -100,7 +100,7 @@ std::string getResourceStream(const std::wstring& libraryName, size_t resourceId //--------------- implementation--------------------------------------------------- -#ifdef FFS_WIN +#ifdef ZEN_WIN inline std::string getResourceStream(const wchar_t* libraryName, size_t resourceId) { |