aboutsummaryrefslogtreecommitdiff
path: root/C
diff options
context:
space:
mode:
Diffstat (limited to 'C')
-rw-r--r--C/7zVersion.h6
-rw-r--r--C/7zip_gcc_c.mak42
-rw-r--r--C/CpuArch.h17
-rw-r--r--C/DllSecur.c8
-rw-r--r--C/LzmaEnc.c11
-rw-r--r--C/Util/7zipInstall/7zipInstall.c8
-rw-r--r--C/Util/7zipUninstall/7zipUninstall.c6
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
19LDFLAGS_STATIC = -DNDEBUG
20# -static
21
22ifdef SystemDrive 19ifdef SystemDrive
23IS_MINGW = 1 20IS_MINGW = 1
21else
22ifdef SYSTEMDRIVE
23# ifdef OS
24IS_MINGW = 1
25endif
26endif
27
28ifdef IS_MINGW
29LDFLAGS_STATIC_2 = -static
30else
31ifndef DEF_FILE
32ifndef IS_NOT_STANDALONE
33ifndef MY_DYNAMIC_LINK
34ifneq ($(CC), clang)
35LDFLAGS_STATIC_2 =
36# -static
37# -static-libstdc++ -static-libgcc
38endif
39endif
40endif
24endif 41endif
42endif
43
44LDFLAGS_STATIC = -DNDEBUG $(LDFLAGS_STATIC_2)
25 45
26ifdef DEF_FILE 46ifdef DEF_FILE
27 47
@@ -62,15 +82,22 @@ endif
62 82
63ifdef IS_MINGW 83ifdef IS_MINGW
64 84
85ifdef MSYSTEM
86RM = rm -f
87MY_MKDIR=mkdir -p
88DEL_OBJ_EXE = -$(RM) $(PROGPATH) $(PROGPATH_STATIC) $(OBJS)
89else
65RM = del 90RM = del
66MY_MKDIR=mkdir 91MY_MKDIR=mkdir
67LIB2 = -loleaut32 -luuid -ladvapi32 -lUser32 92DEL_OBJ_EXE = -$(RM) $(O)\*.o $(O)\$(PROG).exe $(O)\$(PROG).dll
93endif
94
68 95
96LIB2 = -lOle32 -loleaut32 -luuid -ladvapi32 -lUser32
69 97
70CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE 98CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE
71# -Wno-delete-non-virtual-dtor 99# -Wno-delete-non-virtual-dtor
72 100
73DEL_OBJ_EXE = -$(RM) $(O)\*.o $(O)\$(PROG).exe $(O)\$(PROG).dll
74 101
75else 102else
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
312clean: 342clean:
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
22021-07-13 : Igor Pavlov : Public domain */ 22022-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
22021-12-25 : Igor Pavlov : Public domain */ 22022-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
14typedef BOOL (WINAPI *Func_SetDefaultDllDirectories)(DWORD DirectoryFlags); 18typedef 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
39void My_SetDefaultDllDirectories() 43void 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
22021-11-18: Igor Pavlov : Public domain */ 22022-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
2973SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, 2974SRes 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
22021-09-02 : Igor Pavlov : Public domain */ 22022-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
76static LPCWSTR const k_7zip_with_Ver_str = k_7zip_with_Ver; 80static 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
22021-11-24 : Igor Pavlov : Public domain */ 22022-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