Skip to content

Commit 82f3593

Browse files
committed
Merge branch 'hotfix/v4.0.11'
2 parents 0f03717 + bc5c6c0 commit 82f3593

30 files changed

Lines changed: 1834 additions & 530 deletions

.github/workflows/ctest.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717

1818
matrix:
19-
os: [ubuntu-22.04, windows-latest, macos-13]
19+
os: [ubuntu-22.04, windows-latest, macos-14]
2020
build_type: [Debug, Release]
2121
c_compiler: [gcc, clang, cl]
2222
bit7z_auto_format: [OFF, ON]
@@ -39,7 +39,7 @@ jobs:
3939
c_compiler: clang
4040
cpp_compiler: clang++
4141
use_system_7zip: OFF
42-
- os: macos-13
42+
- os: macos-14
4343
c_compiler: clang
4444
cpp_compiler: clang++
4545
use_system_7zip: OFF
@@ -63,17 +63,17 @@ jobs:
6363
bit7z_use_system_codepage: ON
6464
- os: ubuntu-22.04
6565
bit7z_path_sanitization: ON
66-
- os: macos-13
66+
- os: macos-14
6767
c_compiler: cl
68-
- os: macos-13
68+
- os: macos-14
6969
c_compiler: gcc
70-
- os: macos-13
70+
- os: macos-14
7171
bit7z_use_native_string: ON
72-
- os: macos-13
72+
- os: macos-14
7373
bit7z_auto_prefix_long_paths: ON
74-
- os: macos-13
74+
- os: macos-14
7575
bit7z_use_system_codepage: ON
76-
- os: macos-13
76+
- os: macos-14
7777
bit7z_path_sanitization: ON
7878

7979
steps:
@@ -129,13 +129,13 @@ jobs:
129129
130130
- name: Build 7z.so for tests (macOS)
131131
shell: bash
132-
if: matrix.os == 'macos-13'
132+
if: matrix.os == 'macos-14'
133133
run: |
134134
git clone --depth 1 https://github.com/rikyoz/7-Zip ${{ github.workspace }}/../7-zip
135135
sed -i '' 's/-Wno-poison-system-directories/-Wno-poison-system-directories -Wno-declaration-after-statement\r/' ${{ github.workspace }}/../7-zip/CPP/7zip/warn_clang_mac.mak
136136
cd ${{ github.workspace }}/../7-zip/CPP/7zip/Bundles/Format7zF/
137-
make -j -f ../../cmpl_mac_x64.mak
138-
cp b/m_x64/7z.so ${{ github.workspace }}/bin/x64/7z.so
137+
make -j -f ../../cmpl_mac_arm64.mak
138+
cp b/m_arm64/7z.so ${{ github.workspace }}/bin/arm64/7z.so
139139
140140
- name: Test bit7z
141141
working-directory: ${{ steps.strings.outputs.build-output-dir }}

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
cmake_minimum_required( VERSION 3.14 )
66

77
project( bit7z
8-
VERSION 4.0.9
8+
VERSION 4.0.11
99
DESCRIPTION "A C++ static library offering a clean and simple interface to the 7-zip/p7zip shared libraries"
1010
HOMEPAGE_URL "https://github.com/rikyoz/bit7z/" )
1111
set( CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON" )
@@ -216,7 +216,7 @@ target_include_directories( ${LIB_TARGET} PRIVATE "${PROJECT_SOURCE_DIR}/include
216216
target_compile_definitions( ${LIB_TARGET} PRIVATE UNICODE _UNICODE )
217217
if( WIN32 )
218218
target_compile_definitions( ${LIB_TARGET} PRIVATE _WINDOWS )
219-
target_link_libraries( ${LIB_TARGET} PUBLIC oleaut32 )
219+
target_link_libraries( ${LIB_TARGET} PUBLIC oleaut32 user32 )
220220
endif()
221221

222222
if( MINGW )

appveyor.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ image:
66
- Visual Studio 2017
77
- Visual Studio 2019
88
- Visual Studio 2022
9-
- Ubuntu
9+
- Ubuntu2204
1010

1111
environment:
1212
bit7z_version: $(APPVEYOR_REPO_TAG_NAME)
@@ -87,18 +87,18 @@ matrix:
8787
compiler: gcc
8888
- image: Visual Studio 2022
8989
compiler: clang
90-
- image: Ubuntu
90+
- image: Ubuntu2204
9191
compiler: msvc
92-
- image: Ubuntu
92+
- image: Ubuntu2204
9393
compiler: msvc_mt
94-
- image: Ubuntu
94+
- image: Ubuntu2204
9595
compiler: mingw
9696

9797
for:
9898
-
9999
matrix:
100100
only:
101-
- image: Ubuntu
101+
- image: Ubuntu2204
102102

103103
init: |-
104104
if [ "${compiler}" = "gcc" ];
@@ -109,8 +109,9 @@ for:
109109
fi
110110
if [ "${arch}" = "x86" ];
111111
then
112+
sudo dpkg --add-architecture i386;
112113
sudo apt-get update;
113-
sudo apt-get install -y g++-9-multilib;
114+
sudo apt-get install -y g++-9-multilib g++-multilib;
114115
fi
115116
116117
before_build:
@@ -198,7 +199,7 @@ deploy:
198199
tag: $(APPVEYOR_REPO_TAG_NAME)
199200
description: 'Binaries of Bit7z %bit7z_version%'
200201
auth_token:
201-
secure: aaQkoEIZv7oaBSZT2f/bST7NfLOdqKXitnhWmUqaW1T493Pr2/atcZWHIlExsLAx
202+
secure: 6pdVHTqUdC/RroPCFMLAYFs9qd7qn5QlYKdBO8x4t9a9Kd0rxI67WyGkYHgZQ3w9
202203
artifact: /.*\.7z/
203204
draft: true
204205
prerelease: false

cmake/BuildOptions.cmake

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,6 @@ if( WIN32 )
100100
if( BIT7Z_USE_SYSTEM_CODEPAGE )
101101
target_compile_definitions( ${LIB_TARGET} PUBLIC BIT7Z_USE_SYSTEM_CODEPAGE )
102102
endif()
103-
104-
option( BIT7Z_PATH_SANITIZATION "Enable or disable path sanitization when extracting archives \
105-
containing files with invalid Windows names" )
106-
message( STATUS "Path sanitization: ${BIT7Z_PATH_SANITIZATION}" )
107-
if( BIT7Z_PATH_SANITIZATION )
108-
target_compile_definitions( ${LIB_TARGET} PUBLIC BIT7Z_PATH_SANITIZATION )
109-
endif()
110103
else()
111104
if( BIT7Z_7ZIP_VERSION VERSION_LESS "23.01" )
112105
set( BIT7Z_USE_LEGACY_IUNKNOWN ON )
@@ -118,4 +111,11 @@ else()
118111
if( BIT7Z_USE_LEGACY_IUNKNOWN )
119112
target_compile_definitions( ${LIB_TARGET} PUBLIC BIT7Z_USE_LEGACY_IUNKNOWN )
120113
endif()
114+
endif()
115+
116+
option( BIT7Z_PATH_SANITIZATION "Enable or disable path sanitization when extracting archives \
117+
containing files with invalid paths" )
118+
message( STATUS "Path sanitization: ${BIT7Z_PATH_SANITIZATION}" )
119+
if( BIT7Z_PATH_SANITIZATION )
120+
target_compile_definitions( ${LIB_TARGET} PUBLIC BIT7Z_PATH_SANITIZATION )
121121
endif()

cmake/CompilerOptions.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ if( MSVC )
3333

3434
# C++ standard conformance options of MSVC
3535
target_compile_options( ${LIB_TARGET} PRIVATE /fp:precise /Zc:wchar_t /Zc:rvalueCast /Zc:inline
36-
/Zc:forScope /Zc:strictStrings /Zc:throwingNew /Zc:referenceBinding )
36+
/Zc:forScope /Zc:strictStrings )
37+
38+
if( NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
39+
target_compile_options( ${LIB_TARGET} PRIVATE /Zc:throwingNew /Zc:referenceBinding )
40+
endif()
3741

3842
if( CMAKE_GENERATOR MATCHES "Visual Studio" )
3943
target_compile_options( ${LIB_TARGET} PRIVATE /MP$ENV{NUMBER_OF_PROCESSORS} )

cmake/Dependencies.cmake

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Downloading the CPM.cmake package manager
2-
set( CPM_DOWNLOAD_VERSION 0.40.2 )
3-
set( CPM_DOWNLOAD_HASH "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d" )
4-
set( CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake" )
2+
set( CPM_DOWNLOAD_VERSION 0.42.0 )
3+
set( CPM_DOWNLOAD_HASH "2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a" )
4+
if( CPM_SOURCE_CACHE )
5+
set( CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake" )
6+
elseif( DEFINED ENV{CPM_SOURCE_CACHE} )
7+
set( CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake" )
8+
else()
9+
set( CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake" )
10+
endif()
11+
get_filename_component( CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE )
12+
set( CPM_USE_NAMED_CACHE_DIRECTORIES ON )
513
if( NOT ( EXISTS ${CPM_DOWNLOAD_LOCATION} ) )
614
message( STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}" )
715
file( DOWNLOAD
@@ -30,7 +38,7 @@ endif()
3038
if( NOT USE_STANDARD_FILESYSTEM OR NOT STANDARD_FILESYSTEM_COMPILES OR BIT7Z_BUILD_TESTS )
3139
CPMAddPackage( NAME ghc_filesystem
3240
GITHUB_REPOSITORY rikyoz/filesystem
33-
GIT_TAG 983650f374699e3979f9cdefe13ddff60bd4ac68
41+
GIT_TAG b99c2aebd5ddd6fb2f190731ba80b949fc3842b5
3442
DOWNLOAD_ONLY YES )
3543
if( ghc_filesystem_ADDED )
3644
message( STATUS "ghc::filesystem source code available at ${ghc_filesystem_SOURCE_DIR}" )

include/bit7z/biterror.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ enum struct BitError {
4141
UnsupportedVariantType,
4242
WrongUpdateMode,
4343
InvalidZipPassword,
44+
InvalidDirectoryPath,
45+
ItemPathOutsideOutputDirectory,
46+
ItemHasAbsolutePath
4447
};
4548

4649
auto make_error_code( BitError error ) -> std::error_code;

include/bit7z/bitformat.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ extern const BitInFormat Lzma; ///< LZMA Archive Format
185185
extern const BitInFormat Lzma86; ///< LZMA86 Archive Format
186186
extern const BitInFormat Ppmd; ///< PPMD Archive Format
187187
extern const BitInFormat Zstd; ///< ZSTD Archive Format
188+
extern const BitInFormat LVM; ///< LVM Archive Format
189+
extern const BitInFormat AVB; ///< AVB Archive Format
190+
extern const BitInFormat LP; ///< LP Archive Format
191+
extern const BitInFormat Sparse; ///< Sparse Archive Format
192+
extern const BitInFormat APFS; ///< APFS Archive Format
188193
extern const BitInFormat Vhdx; ///< VHDX Archive Format
189194
extern const BitInFormat COFF; ///< COFF Archive Format
190195
extern const BitInFormat Ext; ///< EXT Archive Format

include/bit7z/bittypes.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ using native_string = std::wstring;
7272
using native_string = std::string;
7373
#define BIT7Z_NATIVE_STRING( str ) str
7474
#endif
75+
using native_char = native_string::value_type;
7576

7677
/**
7778
* @note On Windows, if the `BIT7Z_USE_NATIVE_STRING` option is enabled, `tchar` is an alias of `wchar_t`.

include/bit7z/bitwindows.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ constexpr auto ERROR_NO_MORE_FILES = 0x100018;
106106
constexpr auto ERROR_DIRECTORY = 267;
107107
#endif
108108

109+
#ifndef CP_UTF8
110+
// Win32 codepages
111+
constexpr auto CP_UTF8 = 65001u;
112+
#endif
113+
109114
// Win32 structs.
110115
struct FILETIME {
111116
DWORD dwLowDateTime;

0 commit comments

Comments
 (0)