From fc662341e6f85da78ada0e443f6116b978f79f22 Mon Sep 17 00:00:00 2001 From: Igor Pavlov <87184205+ip7z@users.noreply.github.com> Date: Tue, 14 May 2024 00:00:00 +0000 Subject: 24.05 --- C/Util/7z/7z.dsp | 8 +++- C/Util/7z/7zMain.c | 45 +++++++++++----------- C/Util/7z/Precomp.h | 13 +++---- C/Util/7z/makefile | 8 +++- C/Util/7zipInstall/7zipInstall.c | 32 +++++++-------- C/Util/7zipInstall/Precomp.h | 13 +++---- C/Util/7zipInstall/makefile | 9 +++-- C/Util/7zipInstall/resource.rc | 5 ++- C/Util/7zipUninstall/7zipUninstall.c | 75 ++++++++++++++++++++++-------------- C/Util/7zipUninstall/Precomp.h | 13 +++---- C/Util/7zipUninstall/resource.rc | 5 ++- C/Util/Lzma/Precomp.h | 13 +++---- C/Util/LzmaLib/Precomp.h | 13 +++---- C/Util/LzmaLib/makefile | 7 +++- C/Util/SfxSetup/Precomp.h | 13 +++---- C/Util/SfxSetup/SfxSetup.c | 17 ++++---- C/Util/SfxSetup/makefile | 8 +++- 17 files changed, 166 insertions(+), 131 deletions(-) (limited to 'C/Util') diff --git a/C/Util/7z/7z.dsp b/C/Util/7z/7z.dsp index 11e1b03..474c660 100644 --- a/C/Util/7z/7z.dsp +++ b/C/Util/7z/7z.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W4 /WX /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /D "Z7_PPMD_SUPPORT" /FAcs /Yu"Precomp.h" /FD /c +# ADD CPP /nologo /MD /W4 /WX /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /D "Z7_PPMD_SUPPORT" /D "Z7_EXTRACT_ONLY" /FAcs /Yu"Precomp.h" /FD /c # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe @@ -67,7 +67,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W4 /WX /Gm /GX /ZI /Od /D "_DEBUG" /D "_SZ_ALLOC_DEBUG2" /D "_SZ_NO_INT_64_A" /D "WIN32" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /D "Z7_PPMD_SUPPORT" /Yu"Precomp.h" /FD /GZ /c +# ADD CPP /nologo /W4 /WX /Gm /GX /ZI /Od /D "_DEBUG" /D "_SZ_ALLOC_DEBUG2" /D "_SZ_NO_INT_64_A" /D "WIN32" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /D "Z7_PPMD_SUPPORT" /D "Z7_EXTRACT_ONLY" /Yu"Precomp.h" /FD /GZ /c # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe @@ -234,6 +234,10 @@ SOURCE=.\Precomp.c # End Source File # Begin Source File +SOURCE=..\..\Precomp.h +# End Source File +# Begin Source File + SOURCE=.\Precomp.h # End Source File # End Group diff --git a/C/Util/7z/7zMain.c b/C/Util/7z/7zMain.c index 547920a..6baf979 100644 --- a/C/Util/7z/7zMain.c +++ b/C/Util/7z/7zMain.c @@ -1,20 +1,11 @@ /* 7zMain.c - Test application for 7z Decoder -2023-04-04 : Igor Pavlov : Public domain */ +2024-02-28 : Igor Pavlov : Public domain */ #include "Precomp.h" #include #include -#include "../../CpuArch.h" - -#include "../../7z.h" -#include "../../7zAlloc.h" -#include "../../7zBuf.h" -#include "../../7zCrc.h" -#include "../../7zFile.h" -#include "../../7zVersion.h" - #ifndef USE_WINDOWS_FILE /* for mkdir */ #ifdef _WIN32 @@ -32,6 +23,15 @@ #endif #endif +#include "../../7zFile.h" +#include "../../7z.h" +#include "../../7zAlloc.h" +#include "../../7zBuf.h" +#include "../../7zCrc.h" +#include "../../7zVersion.h" + +#include "../../CpuArch.h" + #define kInputBufSize ((size_t)1 << 18) static const ISzAlloc g_Alloc = { SzAlloc, SzFree }; @@ -168,12 +168,12 @@ static SRes Utf16_To_Char(CBuf *buf, const UInt16 *s #endif ) { - unsigned len = 0; + size_t len = 0; for (len = 0; s[len] != 0; len++) {} #ifndef MY_USE_UTF8 { - const unsigned size = len * 3 + 100; + const size_t size = len * 3 + 100; if (!Buf_EnsureSize(buf, size)) return SZ_ERROR_MEM; { @@ -320,21 +320,20 @@ static void UIntToStr_2(char *s, unsigned value) // typedef long BOOL; typedef int BOOL; -typedef struct _FILETIME +typedef struct { DWORD dwLowDateTime; DWORD dwHighDateTime; } FILETIME; -static LONG TIME_GetBias() +static LONG TIME_GetBias(void) { const time_t utc = time(NULL); struct tm *ptm = localtime(&utc); const int localdaylight = ptm->tm_isdst; /* daylight for local timezone */ ptm = gmtime(&utc); ptm->tm_isdst = localdaylight; /* use local daylight, not that of Greenwich */ - const LONG bias = (int)(mktime(ptm) - utc); - return bias; + return (int)(mktime(ptm) - utc); } #define TICKS_PER_SEC 10000000 @@ -359,11 +358,11 @@ static BOOL WINAPI FileTimeToLocalFileTime(const FILETIME *fileTime, FILETIME *l static const UInt32 kNumTimeQuantumsInSecond = 10000000; static const UInt32 kFileTimeStartYear = 1601; static const UInt32 kUnixTimeStartYear = 1970; -static const UInt64 kUnixTimeOffset = - (UInt64)60 * 60 * 24 * (89 + 365 * (kUnixTimeStartYear - kFileTimeStartYear)); static Int64 Time_FileTimeToUnixTime64(const FILETIME *ft) { + const UInt64 kUnixTimeOffset = + (UInt64)60 * 60 * 24 * (89 + 365 * (kUnixTimeStartYear - kFileTimeStartYear)); const UInt64 winTime = GET_TIME_64(ft); return (Int64)(winTime / kNumTimeQuantumsInSecond) - (Int64)kUnixTimeOffset; } @@ -384,8 +383,10 @@ static void FILETIME_To_timespec(const FILETIME *ft, struct MY_ST_TIMESPEC *ts) if (sec2 == sec) { ts->tv_sec = sec2; - const UInt64 winTime = GET_TIME_64(ft); - ts->tv_nsec = (long)((winTime % 10000000) * 100); + { + const UInt64 winTime = GET_TIME_64(ft); + ts->tv_nsec = (long)((winTime % 10000000) * 100); + } return; } } @@ -429,7 +430,7 @@ static void ConvertFileTimeToString(const CNtfsFileTime *nTime, char *s) { unsigned year, mon, hour, min, sec; Byte ms[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - unsigned t; + UInt32 t; UInt32 v; // UInt64 v64 = nt->Low | ((UInt64)nt->High << 32); UInt64 v64; @@ -461,7 +462,7 @@ static void ConvertFileTimeToString(const CNtfsFileTime *nTime, char *s) ms[1] = 29; for (mon = 0;; mon++) { - const unsigned d = ms[mon]; + const UInt32 d = ms[mon]; if (v < d) break; v -= d; diff --git a/C/Util/7z/Precomp.h b/C/Util/7z/Precomp.h index bc8fa21..13a41ef 100644 --- a/C/Util/7z/Precomp.h +++ b/C/Util/7z/Precomp.h @@ -1,14 +1,13 @@ -/* Precomp.h -- StdAfx -2023-03-04 : Igor Pavlov : Public domain */ +/* Precomp.h -- Precomp +2024-01-23 : Igor Pavlov : Public domain */ -#ifndef ZIP7_INC_PRECOMP_H -#define ZIP7_INC_PRECOMP_H +// #ifndef ZIP7_INC_PRECOMP_LOC_H +// #define ZIP7_INC_PRECOMP_LOC_H #if defined(_MSC_VER) && _MSC_VER >= 1800 #pragma warning(disable : 4464) // relative include path contains '..' #endif -#include "../../Compiler.h" -#include "../../7zTypes.h" +#include "../../Precomp.h" -#endif +// #endif diff --git a/C/Util/7z/makefile b/C/Util/7z/makefile index dfc560e..987f065 100644 --- a/C/Util/7z/makefile +++ b/C/Util/7z/makefile @@ -5,8 +5,6 @@ PROG = 7zDec.exe C_OBJS = \ $O\7zAlloc.obj \ $O\7zBuf.obj \ - $O\7zCrc.obj \ - $O\7zCrcOpt.obj \ $O\7zFile.obj \ $O\7zDec.obj \ $O\7zArcIn.obj \ @@ -25,10 +23,14 @@ C_OBJS = \ 7Z_OBJS = \ $O\7zMain.obj \ +!include "../../../CPP/7zip/Crc.mak" +!include "../../../CPP/7zip/LzmaDec.mak" + OBJS = \ $O\Precomp.obj \ $(7Z_OBJS) \ $(C_OBJS) \ + $(ASM_OBJS) \ !include "../../../CPP/Build.mak" @@ -38,3 +40,5 @@ $(C_OBJS): ../../$(*B).c $(CCOMPL_USE) $O\Precomp.obj: Precomp.c $(CCOMPL_PCH) + +!include "../../Asm_c.mak" diff --git a/C/Util/7zipInstall/7zipInstall.c b/C/Util/7zipInstall/7zipInstall.c index 7f5fd19..7d8e8c4 100644 --- a/C/Util/7zipInstall/7zipInstall.c +++ b/C/Util/7zipInstall/7zipInstall.c @@ -1,5 +1,5 @@ /* 7zipInstall.c - 7-Zip Installer -2023-04-04 : Igor Pavlov : Public domain */ +2024-04-05 : Igor Pavlov : Public domain */ #include "Precomp.h" @@ -11,6 +11,8 @@ #pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union #endif +Z7_DIAGNOSTIC_IGNORE_CAST_FUNCTION + #ifdef Z7_OLD_WIN_SDK struct IShellView; #define SHFOLDERAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE @@ -41,16 +43,6 @@ typedef enum { // #pragma GCC diagnostic ignored "-Wcast-function-type" #endif -#if defined(__clang__) || defined(__GNUC__) -typedef void (*Z7_voidFunction)(void); -#define MY_CAST_FUNC (Z7_voidFunction) -#elif defined(_MSC_VER) && _MSC_VER > 1920 -#define MY_CAST_FUNC (void *) -// #pragma warning(disable : 4191) // 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)()' -#else -#define MY_CAST_FUNC -#endif - #define LLL_(quote) L##quote #define LLL(quote) LLL_(quote) @@ -118,11 +110,13 @@ static LPCWSTR const k_Reg_Path32 = L"Path" #define k_Reg_WOW_Flag 0 #endif +#ifdef USE_7ZIP_32_DLL #ifdef _WIN64 #define k_Reg_WOW_Flag_32 KEY_WOW64_32KEY #else #define k_Reg_WOW_Flag_32 0 #endif +#endif #define k_7zip_CLSID L"{23170F69-40C1-278A-1000-000100020000}" @@ -219,11 +213,11 @@ static DWORD GetFileVersion(LPCWSTR s) return 0; } - my_GetFileVersionInfoSizeW = (Func_GetFileVersionInfoSizeW) MY_CAST_FUNC GetProcAddress(g_version_dll_hModule, + my_GetFileVersionInfoSizeW = (Func_GetFileVersionInfoSizeW) Z7_CAST_FUNC_C GetProcAddress(g_version_dll_hModule, "GetFileVersionInfoSizeW"); - my_GetFileVersionInfoW = (Func_GetFileVersionInfoW) MY_CAST_FUNC GetProcAddress(g_version_dll_hModule, + my_GetFileVersionInfoW = (Func_GetFileVersionInfoW) Z7_CAST_FUNC_C GetProcAddress(g_version_dll_hModule, "GetFileVersionInfoW"); - my_VerQueryValueW = (Func_VerQueryValueW) MY_CAST_FUNC GetProcAddress(g_version_dll_hModule, + my_VerQueryValueW = (Func_VerQueryValueW) Z7_CAST_FUNC_C GetProcAddress(g_version_dll_hModule, "VerQueryValueW"); if (!my_GetFileVersionInfoSizeW @@ -1102,7 +1096,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, { BOOL isWow64 = FALSE; const Func_IsWow64Process func_IsWow64Process = (Func_IsWow64Process) - MY_CAST_FUNC GetProcAddress(GetModuleHandleW(L"kernel32.dll"), + Z7_CAST_FUNC_C GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "IsWow64Process"); if (func_IsWow64Process) @@ -1111,7 +1105,13 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, if (!isWow64) { if (!g_SilentMode) - PrintErrorMessage("This installation requires Windows " MY_CPU_NAME, NULL); + PrintErrorMessage("This installation requires Windows " + #ifdef MY_CPU_X86_OR_AMD64 + "x64" + #else + "64-bit" + #endif + , NULL); return 1; } } diff --git a/C/Util/7zipInstall/Precomp.h b/C/Util/7zipInstall/Precomp.h index bc8fa21..13a41ef 100644 --- a/C/Util/7zipInstall/Precomp.h +++ b/C/Util/7zipInstall/Precomp.h @@ -1,14 +1,13 @@ -/* Precomp.h -- StdAfx -2023-03-04 : Igor Pavlov : Public domain */ +/* Precomp.h -- Precomp +2024-01-23 : Igor Pavlov : Public domain */ -#ifndef ZIP7_INC_PRECOMP_H -#define ZIP7_INC_PRECOMP_H +// #ifndef ZIP7_INC_PRECOMP_LOC_H +// #define ZIP7_INC_PRECOMP_LOC_H #if defined(_MSC_VER) && _MSC_VER >= 1800 #pragma warning(disable : 4464) // relative include path contains '..' #endif -#include "../../Compiler.h" -#include "../../7zTypes.h" +#include "../../Precomp.h" -#endif +// #endif diff --git a/C/Util/7zipInstall/makefile b/C/Util/7zipInstall/makefile index 18e2783..424bd6c 100644 --- a/C/Util/7zipInstall/makefile +++ b/C/Util/7zipInstall/makefile @@ -19,9 +19,6 @@ C_OBJS = \ $O\7zAlloc.obj \ $O\7zArcIn.obj \ $O\7zBuf.obj \ - $O\7zBuf2.obj \ - $O\7zCrc.obj \ - $O\7zCrcOpt.obj \ $O\7zFile.obj \ $O\7zDec.obj \ $O\7zStream.obj \ @@ -34,11 +31,17 @@ C_OBJS = \ OBJS = \ $(MAIN_OBJS) \ $(C_OBJS) \ + $(ASM_OBJS) \ $O\resource.res +!include "../../../CPP/7zip/Crc.mak" +# !include "../../../CPP/7zip/LzmaDec.mak" + !include "../../../CPP/Build.mak" $(MAIN_OBJS): $(*B).c $(COMPL_O1) $(C_OBJS): ../../$(*B).c $(COMPL_O1) + +!include "../../Asm_c.mak" diff --git a/C/Util/7zipInstall/resource.rc b/C/Util/7zipInstall/resource.rc index df6474e..40ed580 100644 --- a/C/Util/7zipInstall/resource.rc +++ b/C/Util/7zipInstall/resource.rc @@ -1,5 +1,6 @@ -#include -#include +#include +// #include +// #include #include #define USE_COPYRIGHT_CR diff --git a/C/Util/7zipUninstall/7zipUninstall.c b/C/Util/7zipUninstall/7zipUninstall.c index 8bc18b3..e7051e2 100644 --- a/C/Util/7zipUninstall/7zipUninstall.c +++ b/C/Util/7zipUninstall/7zipUninstall.c @@ -1,10 +1,11 @@ /* 7zipUninstall.c - 7-Zip Uninstaller -2022-07-15 : Igor Pavlov : Public domain */ +2024-03-21 : Igor Pavlov : Public domain */ #include "Precomp.h" // #define SZ_ERROR_ABORT 100 +#include "../../7zTypes.h" #include "../../7zWindows.h" #if defined(_MSC_VER) && _MSC_VER < 1600 @@ -31,16 +32,7 @@ typedef enum { #include "resource.h" -#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__) - // #pragma GCC diagnostic ignored "-Wcast-function-type" -#endif -#if defined(_MSC_VER) && _MSC_VER > 1920 -#define MY_CAST_FUNC (void *) -// #pragma warning(disable : 4191) // 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)()' -#else -#define MY_CAST_FUNC -#endif #define LLL_(quote) L##quote @@ -101,11 +93,13 @@ static LPCWSTR const k_Reg_Path32 = L"Path" #define k_Reg_WOW_Flag 0 #endif +#ifdef USE_7ZIP_32_DLL #ifdef _WIN64 #define k_Reg_WOW_Flag_32 KEY_WOW64_32KEY #else #define k_Reg_WOW_Flag_32 0 #endif +#endif #define k_7zip_CLSID L"{23170F69-40C1-278A-1000-000100020000}" @@ -124,9 +118,19 @@ static HWND g_Path_HWND; static HWND g_InfoLine_HWND; static HWND g_Progress_HWND; -// WINADVAPI +// RegDeleteKeyExW is supported starting from win2003sp1/xp-pro-x64 +// Z7_WIN32_WINNT_MIN < 0x0600 // Vista +#if !defined(Z7_WIN32_WINNT_MIN) \ + || Z7_WIN32_WINNT_MIN < 0x0502 /* < win2003 */ \ + || Z7_WIN32_WINNT_MIN == 0x0502 && !defined(_M_AMD64) +#define Z7_USE_DYN_RegDeleteKeyExW +#endif + +#ifdef Z7_USE_DYN_RegDeleteKeyExW +Z7_DIAGNOSTIC_IGNORE_CAST_FUNCTION typedef LONG (APIENTRY *Func_RegDeleteKeyExW)(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired, DWORD Reserved); static Func_RegDeleteKeyExW func_RegDeleteKeyExW; +#endif static WCHAR cmd[MAX_PATH + 4]; static WCHAR cmdError[MAX_PATH + 4]; @@ -247,13 +251,18 @@ static LONG MyRegistry_OpenKey_ReadWrite(HKEY parentKey, LPCWSTR name, HKEY *des static LONG MyRegistry_DeleteKey(HKEY parentKey, LPCWSTR name) { - #if k_Reg_WOW_Flag != 0 - if (func_RegDeleteKeyExW) - return func_RegDeleteKeyExW(parentKey, name, k_Reg_WOW_Flag, 0); - return E_FAIL; - #else +#if k_Reg_WOW_Flag != 0 +#ifdef Z7_USE_DYN_RegDeleteKeyExW + if (!func_RegDeleteKeyExW) + return E_FAIL; + return func_RegDeleteKeyExW +#else + return RegDeleteKeyExW +#endif + (parentKey, name, k_Reg_WOW_Flag, 0); +#else return RegDeleteKeyW(parentKey, name); - #endif +#endif } #ifdef USE_7ZIP_32_DLL @@ -278,13 +287,18 @@ static LONG MyRegistry_OpenKey_ReadWrite_32(HKEY parentKey, LPCWSTR name, HKEY * static LONG MyRegistry_DeleteKey_32(HKEY parentKey, LPCWSTR name) { - #if k_Reg_WOW_Flag_32 != 0 - if (func_RegDeleteKeyExW) - return func_RegDeleteKeyExW(parentKey, name, k_Reg_WOW_Flag_32, 0); - return E_FAIL; - #else +#if k_Reg_WOW_Flag_32 != 0 +#ifdef Z7_USE_DYN_RegDeleteKeyExW + if (!func_RegDeleteKeyExW) + return E_FAIL; + return func_RegDeleteKeyExW +#else + return RegDeleteKeyExW +#endif + (parentKey, name, k_Reg_WOW_Flag_32, 0); +#else return RegDeleteKeyW(parentKey, name); - #endif +#endif } #endif @@ -930,14 +944,17 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, UNUSED_VAR(lpCmdLine) UNUSED_VAR(nCmdShow) - #ifndef UNDER_CE +#ifndef UNDER_CE CoInitialize(NULL); - #endif +#endif - #ifndef UNDER_CE - func_RegDeleteKeyExW = (Func_RegDeleteKeyExW) MY_CAST_FUNC - GetProcAddress(GetModuleHandleW(L"advapi32.dll"), "RegDeleteKeyExW"); - #endif +#ifndef UNDER_CE +#ifdef Z7_USE_DYN_RegDeleteKeyExW + func_RegDeleteKeyExW = + (Func_RegDeleteKeyExW) Z7_CAST_FUNC_C GetProcAddress(GetModuleHandleW(L"advapi32.dll"), + "RegDeleteKeyExW"); +#endif +#endif { const wchar_t *s = GetCommandLineW(); diff --git a/C/Util/7zipUninstall/Precomp.h b/C/Util/7zipUninstall/Precomp.h index bc8fa21..13a41ef 100644 --- a/C/Util/7zipUninstall/Precomp.h +++ b/C/Util/7zipUninstall/Precomp.h @@ -1,14 +1,13 @@ -/* Precomp.h -- StdAfx -2023-03-04 : Igor Pavlov : Public domain */ +/* Precomp.h -- Precomp +2024-01-23 : Igor Pavlov : Public domain */ -#ifndef ZIP7_INC_PRECOMP_H -#define ZIP7_INC_PRECOMP_H +// #ifndef ZIP7_INC_PRECOMP_LOC_H +// #define ZIP7_INC_PRECOMP_LOC_H #if defined(_MSC_VER) && _MSC_VER >= 1800 #pragma warning(disable : 4464) // relative include path contains '..' #endif -#include "../../Compiler.h" -#include "../../7zTypes.h" +#include "../../Precomp.h" -#endif +// #endif diff --git a/C/Util/7zipUninstall/resource.rc b/C/Util/7zipUninstall/resource.rc index 00bdcc0..79400c6 100644 --- a/C/Util/7zipUninstall/resource.rc +++ b/C/Util/7zipUninstall/resource.rc @@ -1,5 +1,6 @@ -#include -#include +#include +// #include +// #include #include #define USE_COPYRIGHT_CR diff --git a/C/Util/Lzma/Precomp.h b/C/Util/Lzma/Precomp.h index bc8fa21..13a41ef 100644 --- a/C/Util/Lzma/Precomp.h +++ b/C/Util/Lzma/Precomp.h @@ -1,14 +1,13 @@ -/* Precomp.h -- StdAfx -2023-03-04 : Igor Pavlov : Public domain */ +/* Precomp.h -- Precomp +2024-01-23 : Igor Pavlov : Public domain */ -#ifndef ZIP7_INC_PRECOMP_H -#define ZIP7_INC_PRECOMP_H +// #ifndef ZIP7_INC_PRECOMP_LOC_H +// #define ZIP7_INC_PRECOMP_LOC_H #if defined(_MSC_VER) && _MSC_VER >= 1800 #pragma warning(disable : 4464) // relative include path contains '..' #endif -#include "../../Compiler.h" -#include "../../7zTypes.h" +#include "../../Precomp.h" -#endif +// #endif diff --git a/C/Util/LzmaLib/Precomp.h b/C/Util/LzmaLib/Precomp.h index bc8fa21..13a41ef 100644 --- a/C/Util/LzmaLib/Precomp.h +++ b/C/Util/LzmaLib/Precomp.h @@ -1,14 +1,13 @@ -/* Precomp.h -- StdAfx -2023-03-04 : Igor Pavlov : Public domain */ +/* Precomp.h -- Precomp +2024-01-23 : Igor Pavlov : Public domain */ -#ifndef ZIP7_INC_PRECOMP_H -#define ZIP7_INC_PRECOMP_H +// #ifndef ZIP7_INC_PRECOMP_LOC_H +// #define ZIP7_INC_PRECOMP_LOC_H #if defined(_MSC_VER) && _MSC_VER >= 1800 #pragma warning(disable : 4464) // relative include path contains '..' #endif -#include "../../Compiler.h" -#include "../../7zTypes.h" +#include "../../Precomp.h" -#endif +// #endif diff --git a/C/Util/LzmaLib/makefile b/C/Util/LzmaLib/makefile index b8e054e..9ed0aa4 100644 --- a/C/Util/LzmaLib/makefile +++ b/C/Util/LzmaLib/makefile @@ -14,16 +14,19 @@ C_OBJS = \ $O\CpuArch.obj \ $O\LzFind.obj \ $O\LzFindMt.obj \ - $O\LzFindOpt.obj \ $O\LzmaDec.obj \ $O\LzmaEnc.obj \ $O\LzmaLib.obj \ $O\Threads.obj \ +!include "../../../CPP/7zip/LzFindOpt.mak" +!include "../../../CPP/7zip/LzmaDec.mak" + OBJS = \ $O\Precomp.obj \ $(LIB_OBJS) \ $(C_OBJS) \ + $(ASM_OBJS) \ $O\resource.res !include "../../../CPP/Build.mak" @@ -52,3 +55,5 @@ $(C_OBJS): ../../$(*B).c $(CCOMPLB_USE) !ENDIF + +!include "../../Asm_c.mak" diff --git a/C/Util/SfxSetup/Precomp.h b/C/Util/SfxSetup/Precomp.h index bc8fa21..13a41ef 100644 --- a/C/Util/SfxSetup/Precomp.h +++ b/C/Util/SfxSetup/Precomp.h @@ -1,14 +1,13 @@ -/* Precomp.h -- StdAfx -2023-03-04 : Igor Pavlov : Public domain */ +/* Precomp.h -- Precomp +2024-01-23 : Igor Pavlov : Public domain */ -#ifndef ZIP7_INC_PRECOMP_H -#define ZIP7_INC_PRECOMP_H +// #ifndef ZIP7_INC_PRECOMP_LOC_H +// #define ZIP7_INC_PRECOMP_LOC_H #if defined(_MSC_VER) && _MSC_VER >= 1800 #pragma warning(disable : 4464) // relative include path contains '..' #endif -#include "../../Compiler.h" -#include "../../7zTypes.h" +#include "../../Precomp.h" -#endif +// #endif diff --git a/C/Util/SfxSetup/SfxSetup.c b/C/Util/SfxSetup/SfxSetup.c index 7304a0b..9b5c1f9 100644 --- a/C/Util/SfxSetup/SfxSetup.c +++ b/C/Util/SfxSetup/SfxSetup.c @@ -1,5 +1,5 @@ /* SfxSetup.c - 7z SFX Setup -2019-02-02 : Igor Pavlov : Public domain */ +2024-01-24 : Igor Pavlov : Public domain */ #include "Precomp.h" @@ -278,10 +278,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, #ifdef _CONSOLE SetConsoleCtrlHandler(HandlerRoutine, TRUE); #else - UNUSED_VAR(hInstance); - UNUSED_VAR(hPrevInstance); - UNUSED_VAR(lpCmdLine); - UNUSED_VAR(nCmdShow); + UNUSED_VAR(hInstance) + UNUSED_VAR(hPrevInstance) + UNUSED_VAR(lpCmdLine) + UNUSED_VAR(nCmdShow) #endif CrcGenerateTable(); @@ -516,12 +516,13 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, #endif { - const SRes res2 = File_Close(&outFile); + const WRes res2 = File_Close(&outFile); if (res != SZ_OK) break; - if (res2 != SZ_OK) + if (res2 != 0) { - res = res2; + errorMessage = "Can't close output file"; + res = SZ_ERROR_FAIL; break; } } diff --git a/C/Util/SfxSetup/makefile b/C/Util/SfxSetup/makefile index bc0cf8b..b3f25a2 100644 --- a/C/Util/SfxSetup/makefile +++ b/C/Util/SfxSetup/makefile @@ -9,8 +9,6 @@ C_OBJS = \ $O\7zArcIn.obj \ $O\7zBuf.obj \ $O\7zBuf2.obj \ - $O\7zCrc.obj \ - $O\7zCrcOpt.obj \ $O\7zFile.obj \ $O\7zDec.obj \ $O\7zStream.obj \ @@ -27,9 +25,13 @@ C_OBJS = \ 7Z_OBJS = \ $O\SfxSetup.obj \ +!include "../../../CPP/7zip/Crc.mak" +# !include "../../../CPP/7zip/LzmaDec.mak" + OBJS = \ $(7Z_OBJS) \ $(C_OBJS) \ + $(ASM_OBJS) \ $O\resource.res !include "../../../CPP/Build.mak" @@ -38,3 +40,5 @@ $(7Z_OBJS): $(*B).c $(COMPL_O1) $(C_OBJS): ../../$(*B).c $(COMPL_O1) + +!include "../../Asm_c.mak" -- cgit v1.2.3-55-g6feb