Update to 7-Zip Version 21.02

This commit is contained in:
Tino Reichardt
2021-05-13 16:39:14 +02:00
parent 3724ecfedc
commit 48fa49f76c
620 changed files with 35032 additions and 10925 deletions

View File

@@ -4,6 +4,8 @@
#include "DLL.h"
#ifdef _WIN32
#ifndef _UNICODE
extern bool g_IsNT;
#endif
@@ -97,7 +99,7 @@ FString GetModuleDirPrefix()
{
int pos = s.ReverseFind_PathSepar();
if (pos >= 0)
s.DeleteFrom(pos + 1);
s.DeleteFrom((unsigned)(pos + 1));
}
if (s.IsEmpty())
s = "." STRING_PATH_SEPARATOR;
@@ -107,3 +109,83 @@ FString GetModuleDirPrefix()
#endif
}}
#else
#include <dlfcn.h>
#include <stdlib.h>
namespace NWindows {
namespace NDLL {
bool CLibrary::Free() throw()
{
if (_module == NULL)
return true;
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())
return false;
int options = 0;
#ifdef RTLD_LOCAL
options |= RTLD_LOCAL;
#endif
#ifdef RTLD_NOW
options |= RTLD_NOW;
#endif
#ifdef RTLD_GROUP
#if ! (defined(hpux) || defined(__hpux))
options |= RTLD_GROUP; // mainly for solaris but not for HPUX
#endif
#endif
void *handler = dlopen(path, options);
if (handler)
{
// here we can transfer some settings to DLL
}
else
{
}
_module = handler;
return (_module != NULL);
}
// FARPROC
void * CLibrary::GetProc(LPCSTR procName) const
{
// return My_GetProcAddress(_module, procName);
return local_GetProcAddress(_module, procName);
// return NULL;
}
}}
#endif