diff options
author | 2023-12-06 07:58:49 +1100 | |
---|---|---|
committer | 2023-12-06 07:58:49 +1100 | |
commit | 79bef1e23049fdac25f1fefd132e0b6c7d2cc3a1 (patch) | |
tree | 643e9313fe86f583c4022c338677cbc12b761df7 /3rdparty/lzma/CPP/Windows/DLL.cpp | |
parent | 512ccf0c7c9b4f08e41038b2ed2de220e140385b (diff) |
3rdparty/lzma: Updated to version 23.01.
Diffstat (limited to '3rdparty/lzma/CPP/Windows/DLL.cpp')
-rw-r--r-- | 3rdparty/lzma/CPP/Windows/DLL.cpp | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/3rdparty/lzma/CPP/Windows/DLL.cpp b/3rdparty/lzma/CPP/Windows/DLL.cpp index cf5d01a302c..b2499ecdc0e 100644 --- a/3rdparty/lzma/CPP/Windows/DLL.cpp +++ b/3rdparty/lzma/CPP/Windows/DLL.cpp @@ -17,11 +17,11 @@ namespace NDLL { bool CLibrary::Free() throw() { - if (_module == 0) + if (_module == NULL) return true; if (!::FreeLibrary(_module)) return false; - _module = 0; + _module = NULL; return true; } @@ -90,7 +90,7 @@ bool MyGetModuleFileName(FString &path) return false; } -#ifndef _SFX +#ifndef Z7_SFX FString GetModuleDirPrefix() { @@ -110,38 +110,35 @@ FString GetModuleDirPrefix() }} -#else +#else // _WIN32 #include <dlfcn.h> #include <stdlib.h> +#include "../Common/Common.h" + +// FARPROC +void *GetProcAddress(HMODULE module, LPCSTR procName) +{ + void *ptr = NULL; + if (module) + ptr = dlsym(module, procName); + return ptr; +} namespace NWindows { namespace NDLL { bool CLibrary::Free() throw() { - if (_module == NULL) + if (!_module) return true; - int ret = dlclose(_module); + const int ret = dlclose(_module); if (ret != 0) return false; _module = NULL; return true; } -static -// FARPROC -void * -local_GetProcAddress(HMODULE module, LPCSTR procName) -{ - void *ptr = NULL; - if (module) - { - ptr = dlsym(module, procName); - } - return ptr; -} - bool CLibrary::Load(CFSTR path) throw() { if (!Free()) @@ -163,21 +160,11 @@ bool CLibrary::Load(CFSTR path) throw() #endif #endif - void *handler = dlopen(path, options); - - if (handler) - { - // here we can transfer some settings to DLL - } - else - { - } - - _module = handler; - + _module = dlopen(path, options); return (_module != NULL); } +/* // FARPROC void * CLibrary::GetProc(LPCSTR procName) const { @@ -185,6 +172,7 @@ void * CLibrary::GetProc(LPCSTR procName) const return local_GetProcAddress(_module, procName); // return NULL; } +*/ }} |