diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2022-07-16 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-12-17 14:35:38 +0500 |
commit | 93be7d4abfd4233228f58ee1fbbcd76d91be66a4 (patch) | |
tree | 9b11631a70ca7150321838d9d6bd473e52d6684d /C | |
parent | a3e1d227377188734b82f023f96f8e25dc40f3e6 (diff) | |
download | 7zip-93be7d4abfd4233228f58ee1fbbcd76d91be66a4.tar.gz 7zip-93be7d4abfd4233228f58ee1fbbcd76d91be66a4.tar.bz2 7zip-93be7d4abfd4233228f58ee1fbbcd76d91be66a4.zip |
22.0122.01
Diffstat (limited to 'C')
-rw-r--r-- | C/7zVersion.h | 6 | ||||
-rw-r--r-- | C/7zip_gcc_c.mak | 42 | ||||
-rw-r--r-- | C/CpuArch.h | 17 | ||||
-rw-r--r-- | C/DllSecur.c | 8 | ||||
-rw-r--r-- | C/LzmaEnc.c | 11 | ||||
-rw-r--r-- | C/Util/7zipInstall/7zipInstall.c | 8 | ||||
-rw-r--r-- | C/Util/7zipUninstall/7zipUninstall.c | 6 |
7 files changed, 70 insertions, 28 deletions
diff --git a/C/7zVersion.h b/C/7zVersion.h index 89fffd9..49ea81d 100644 --- a/C/7zVersion.h +++ b/C/7zVersion.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #define MY_VER_MAJOR 22 | 1 | #define MY_VER_MAJOR 22 |
2 | #define MY_VER_MINOR 00 | 2 | #define MY_VER_MINOR 01 |
3 | #define MY_VER_BUILD 0 | 3 | #define MY_VER_BUILD 0 |
4 | #define MY_VERSION_NUMBERS "22.00" | 4 | #define MY_VERSION_NUMBERS "22.01" |
5 | #define MY_VERSION MY_VERSION_NUMBERS | 5 | #define MY_VERSION MY_VERSION_NUMBERS |
6 | 6 | ||
7 | #ifdef MY_CPU_NAME | 7 | #ifdef MY_CPU_NAME |
@@ -10,7 +10,7 @@ | |||
10 | #define MY_VERSION_CPU MY_VERSION | 10 | #define MY_VERSION_CPU MY_VERSION |
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | #define MY_DATE "2022-06-15" | 13 | #define MY_DATE "2022-07-15" |
14 | #undef MY_COPYRIGHT | 14 | #undef MY_COPYRIGHT |
15 | #undef MY_VERSION_COPYRIGHT_DATE | 15 | #undef MY_VERSION_COPYRIGHT_DATE |
16 | #define MY_AUTHOR_NAME "Igor Pavlov" | 16 | #define MY_AUTHOR_NAME "Igor Pavlov" |
diff --git a/C/7zip_gcc_c.mak b/C/7zip_gcc_c.mak index e884440..24505f3 100644 --- a/C/7zip_gcc_c.mak +++ b/C/7zip_gcc_c.mak | |||
@@ -16,12 +16,32 @@ CFLAGS_BASE = $(MY_ARCH_2) -O2 $(CFLAGS_BASE_LIST) -Wall -Werror -Wextra $(CFLAG | |||
16 | -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE | 16 | -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
17 | 17 | ||
18 | 18 | ||
19 | LDFLAGS_STATIC = -DNDEBUG | ||
20 | # -static | ||
21 | |||
22 | ifdef SystemDrive | 19 | ifdef SystemDrive |
23 | IS_MINGW = 1 | 20 | IS_MINGW = 1 |
21 | else | ||
22 | ifdef SYSTEMDRIVE | ||
23 | # ifdef OS | ||
24 | IS_MINGW = 1 | ||
25 | endif | ||
26 | endif | ||
27 | |||
28 | ifdef IS_MINGW | ||
29 | LDFLAGS_STATIC_2 = -static | ||
30 | else | ||
31 | ifndef DEF_FILE | ||
32 | ifndef IS_NOT_STANDALONE | ||
33 | ifndef MY_DYNAMIC_LINK | ||
34 | ifneq ($(CC), clang) | ||
35 | LDFLAGS_STATIC_2 = | ||
36 | # -static | ||
37 | # -static-libstdc++ -static-libgcc | ||
38 | endif | ||
39 | endif | ||
40 | endif | ||
24 | endif | 41 | endif |
42 | endif | ||
43 | |||
44 | LDFLAGS_STATIC = -DNDEBUG $(LDFLAGS_STATIC_2) | ||
25 | 45 | ||
26 | ifdef DEF_FILE | 46 | ifdef DEF_FILE |
27 | 47 | ||
@@ -62,15 +82,22 @@ endif | |||
62 | 82 | ||
63 | ifdef IS_MINGW | 83 | ifdef IS_MINGW |
64 | 84 | ||
85 | ifdef MSYSTEM | ||
86 | RM = rm -f | ||
87 | MY_MKDIR=mkdir -p | ||
88 | DEL_OBJ_EXE = -$(RM) $(PROGPATH) $(PROGPATH_STATIC) $(OBJS) | ||
89 | else | ||
65 | RM = del | 90 | RM = del |
66 | MY_MKDIR=mkdir | 91 | MY_MKDIR=mkdir |
67 | LIB2 = -loleaut32 -luuid -ladvapi32 -lUser32 | 92 | DEL_OBJ_EXE = -$(RM) $(O)\*.o $(O)\$(PROG).exe $(O)\$(PROG).dll |
93 | endif | ||
94 | |||
68 | 95 | ||
96 | LIB2 = -lOle32 -loleaut32 -luuid -ladvapi32 -lUser32 | ||
69 | 97 | ||
70 | CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE | 98 | CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE |
71 | # -Wno-delete-non-virtual-dtor | 99 | # -Wno-delete-non-virtual-dtor |
72 | 100 | ||
73 | DEL_OBJ_EXE = -$(RM) $(O)\*.o $(O)\$(PROG).exe $(O)\$(PROG).dll | ||
74 | 101 | ||
75 | else | 102 | else |
76 | 103 | ||
@@ -306,7 +333,10 @@ $O/7zMain.o: ../../../C/Util/7z/7zMain.c | |||
306 | $(CC) $(CFLAGS) $< | 333 | $(CC) $(CFLAGS) $< |
307 | $O/LzmaUtil.o: ../../../C/Util/Lzma/LzmaUtil.c | 334 | $O/LzmaUtil.o: ../../../C/Util/Lzma/LzmaUtil.c |
308 | $(CC) $(CFLAGS) $< | 335 | $(CC) $(CFLAGS) $< |
309 | 336 | $O/7zipInstall.o: ../../../C/Util/7zipInstall/7zipInstall.c | |
337 | $(CC) $(CFLAGS) $< | ||
338 | $O/7zipUninstall.o: ../../../C/Util/7zipUninstall/7zipUninstall.c | ||
339 | $(CC) $(CFLAGS) $< | ||
310 | 340 | ||
311 | 341 | ||
312 | clean: | 342 | clean: |
diff --git a/C/CpuArch.h b/C/CpuArch.h index 529d3a5..4856fbb 100644 --- a/C/CpuArch.h +++ b/C/CpuArch.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* CpuArch.h -- CPU specific code | 1 | /* CpuArch.h -- CPU specific code |
2 | 2021-07-13 : Igor Pavlov : Public domain */ | 2 | 2022-07-15 : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #ifndef __CPU_ARCH_H | 4 | #ifndef __CPU_ARCH_H |
5 | #define __CPU_ARCH_H | 5 | #define __CPU_ARCH_H |
@@ -123,12 +123,15 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. | |||
123 | #endif | 123 | #endif |
124 | 124 | ||
125 | 125 | ||
126 | #if defined(__sparc64__) | 126 | #if defined(__riscv) \ |
127 | #define MY_CPU_NAME "sparc64" | 127 | || defined(__riscv__) |
128 | #define MY_CPU_64BIT | 128 | #if __riscv_xlen == 32 |
129 | #elif defined(__sparc__) | 129 | #define MY_CPU_NAME "riscv32" |
130 | #define MY_CPU_NAME "sparc" | 130 | #elif __riscv_xlen == 64 |
131 | /* #define MY_CPU_32BIT */ | 131 | #define MY_CPU_NAME "riscv64" |
132 | #else | ||
133 | #define MY_CPU_NAME "riscv" | ||
134 | #endif | ||
132 | #endif | 135 | #endif |
133 | 136 | ||
134 | 137 | ||
diff --git a/C/DllSecur.c b/C/DllSecur.c index d81508c..dce0c96 100644 --- a/C/DllSecur.c +++ b/C/DllSecur.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* DllSecur.c -- DLL loading security | 1 | /* DllSecur.c -- DLL loading security |
2 | 2021-12-25 : Igor Pavlov : Public domain */ | 2 | 2022-07-15 : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
5 | 5 | ||
@@ -11,6 +11,10 @@ | |||
11 | 11 | ||
12 | #ifndef UNDER_CE | 12 | #ifndef UNDER_CE |
13 | 13 | ||
14 | #if defined(__GNUC__) && (__GNUC__ >= 8) | ||
15 | #pragma GCC diagnostic ignored "-Wcast-function-type" | ||
16 | #endif | ||
17 | |||
14 | typedef BOOL (WINAPI *Func_SetDefaultDllDirectories)(DWORD DirectoryFlags); | 18 | typedef BOOL (WINAPI *Func_SetDefaultDllDirectories)(DWORD DirectoryFlags); |
15 | 19 | ||
16 | #define MY_LOAD_LIBRARY_SEARCH_USER_DIRS 0x400 | 20 | #define MY_LOAD_LIBRARY_SEARCH_USER_DIRS 0x400 |
@@ -34,7 +38,7 @@ static const char * const g_Dlls = | |||
34 | #endif | 38 | #endif |
35 | 39 | ||
36 | // #define MY_CAST_FUNC (void(*)()) | 40 | // #define MY_CAST_FUNC (void(*)()) |
37 | #define MY_CAST_FUNC | 41 | #define MY_CAST_FUNC |
38 | 42 | ||
39 | void My_SetDefaultDllDirectories() | 43 | void My_SetDefaultDllDirectories() |
40 | { | 44 | { |
diff --git a/C/LzmaEnc.c b/C/LzmaEnc.c index b04a7b7..c8b31a1 100644 --- a/C/LzmaEnc.c +++ b/C/LzmaEnc.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* LzmaEnc.c -- LZMA Encoder | 1 | /* LzmaEnc.c -- LZMA Encoder |
2 | 2021-11-18: Igor Pavlov : Public domain */ | 2 | 2022-07-15: Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
5 | 5 | ||
@@ -2970,6 +2970,7 @@ const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) | |||
2970 | } | 2970 | } |
2971 | 2971 | ||
2972 | 2972 | ||
2973 | // (desiredPackSize == 0) is not allowed | ||
2973 | SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, | 2974 | SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, |
2974 | Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) | 2975 | Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) |
2975 | { | 2976 | { |
@@ -2990,14 +2991,10 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, | |||
2990 | if (reInit) | 2991 | if (reInit) |
2991 | LzmaEnc_Init(p); | 2992 | LzmaEnc_Init(p); |
2992 | LzmaEnc_InitPrices(p); | 2993 | LzmaEnc_InitPrices(p); |
2993 | |||
2994 | nowPos64 = p->nowPos64; | ||
2995 | RangeEnc_Init(&p->rc); | 2994 | RangeEnc_Init(&p->rc); |
2996 | p->rc.outStream = &outStream.vt; | 2995 | p->rc.outStream = &outStream.vt; |
2997 | 2996 | nowPos64 = p->nowPos64; | |
2998 | if (desiredPackSize == 0) | 2997 | |
2999 | return SZ_ERROR_OUTPUT_EOF; | ||
3000 | |||
3001 | res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize); | 2998 | res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize); |
3002 | 2999 | ||
3003 | *unpackSize = (UInt32)(p->nowPos64 - nowPos64); | 3000 | *unpackSize = (UInt32)(p->nowPos64 - nowPos64); |
diff --git a/C/Util/7zipInstall/7zipInstall.c b/C/Util/7zipInstall/7zipInstall.c index 00d0f41..2649734 100644 --- a/C/Util/7zipInstall/7zipInstall.c +++ b/C/Util/7zipInstall/7zipInstall.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* 7zipInstall.c - 7-Zip Installer | 1 | /* 7zipInstall.c - 7-Zip Installer |
2 | 2021-09-02 : Igor Pavlov : Public domain */ | 2 | 2022-07-15 : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
5 | 5 | ||
@@ -22,6 +22,10 @@ | |||
22 | 22 | ||
23 | #include "resource.h" | 23 | #include "resource.h" |
24 | 24 | ||
25 | #if defined(__GNUC__) && (__GNUC__ >= 8) | ||
26 | #pragma GCC diagnostic ignored "-Wcast-function-type" | ||
27 | #endif | ||
28 | |||
25 | #define LLL_(quote) L##quote | 29 | #define LLL_(quote) L##quote |
26 | #define LLL(quote) LLL_(quote) | 30 | #define LLL(quote) LLL_(quote) |
27 | 31 | ||
@@ -70,7 +74,7 @@ static LPCWSTR const k_Reg_Software_7zip = L"Software\\7-Zip"; | |||
70 | #endif | 74 | #endif |
71 | #endif | 75 | #endif |
72 | 76 | ||
73 | #define k_7zip_with_Ver k_7zip_with_Ver_base k_Postfix | 77 | #define k_7zip_with_Ver k_7zip_with_Ver_base k_Postfix |
74 | 78 | ||
75 | 79 | ||
76 | static LPCWSTR const k_7zip_with_Ver_str = k_7zip_with_Ver; | 80 | static LPCWSTR const k_7zip_with_Ver_str = k_7zip_with_Ver; |
diff --git a/C/Util/7zipUninstall/7zipUninstall.c b/C/Util/7zipUninstall/7zipUninstall.c index b4c6ff5..c8e8a89 100644 --- a/C/Util/7zipUninstall/7zipUninstall.c +++ b/C/Util/7zipUninstall/7zipUninstall.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* 7zipUninstall.c - 7-Zip Uninstaller | 1 | /* 7zipUninstall.c - 7-Zip Uninstaller |
2 | 2021-11-24 : Igor Pavlov : Public domain */ | 2 | 2022-07-15 : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
5 | 5 | ||
@@ -17,6 +17,10 @@ | |||
17 | 17 | ||
18 | #include "resource.h" | 18 | #include "resource.h" |
19 | 19 | ||
20 | #if defined(__GNUC__) && (__GNUC__ >= 8) | ||
21 | #pragma GCC diagnostic ignored "-Wcast-function-type" | ||
22 | #endif | ||
23 | |||
20 | #define LLL_(quote) L##quote | 24 | #define LLL_(quote) L##quote |
21 | #define LLL(quote) LLL_(quote) | 25 | #define LLL(quote) LLL_(quote) |
22 | 26 | ||