cmake update

This commit is contained in:
Markus F.X.J. Oberhumer
2023-11-13 11:29:17 +01:00
parent dc23ee0ad2
commit c479fe32b3
7 changed files with 98 additions and 59 deletions
+3 -1
View File
@@ -43,9 +43,11 @@
#pragma GCC diagnostic ignored "-Wshadow"
#endif
#if !defined(UPX_DOCTEST_CONFIG_MULTITHREADING)
#if !defined(UPX_DOCTEST_CONFIG_MULTITHREADING) && !(WITH_THREADS)
#ifndef DOCTEST_CONFIG_NO_MULTITHREADING
#define DOCTEST_CONFIG_NO_MULTITHREADING
#endif
#endif
#if defined(__clang__) && defined(__FAST_MATH__) && defined(__INTEL_LLVM_COMPILER)
// warning: comparison with NaN always evaluates to false in fast floating point modes
+1 -1
View File
@@ -197,7 +197,7 @@ typedef upx_int64_t upx_off_t;
// portab
**************************************************************************/
// some system headers may define these, so undef just in case
// some platform system headers may pre-define these, so undef to avoid conflicts
#undef _
#undef __
#undef ___
-3
View File
@@ -113,9 +113,6 @@ static_assert(sizeof(void *) == 8);
#include <type_traits>
// C++ multithreading (UPX currently does not use multithreading)
#ifndef WITH_THREADS
#define WITH_THREADS 0
#endif
#if __STDC_NO_ATOMICS__
#undef WITH_THREADS
#endif
+4 -2
View File
@@ -67,9 +67,9 @@ struct Options final {
int level; // compression level 1..10
int filter; // preferred filter from Packer::getFilters()
bool ultra_brute;
bool all_methods; // try all available compression methods ?
bool all_methods; // try all available compression methods
int all_methods_use_lzma;
bool all_filters; // try all available filters ?
bool all_filters; // try all available filters
bool no_filter; // force no filter
bool prefer_ucl; // prefer UCL
bool exact; // user requires byte-identical decompression
@@ -120,11 +120,13 @@ struct Options final {
// CRP - Compression Runtime Parameters (undocumented and subject to change)
struct {
bzip2_compress_config_t crp_bzip2;
lzma_compress_config_t crp_lzma;
ucl_compress_config_t crp_ucl;
zlib_compress_config_t crp_zlib;
zstd_compress_config_t crp_zstd;
void reset() noexcept {
crp_bzip2.reset();
crp_lzma.reset();
crp_ucl.reset();
crp_zlib.reset();
+4 -4
View File
@@ -36,14 +36,14 @@
#if WITH_XSPAN
// automatic conversion to underlying pointer; do NOT enable this config as this
// Automatic conversion to underlying pointer; do NOT enable this config as this
// defeats the main purpose of a checked pointer => use raw_bytes() as needed;
// and see xspan_fwd.h how to make this more convenient
// and see xspan_fwd.h how to make this more convenient.
#ifndef XSPAN_CONFIG_ENABLE_IMPLICIT_CONVERSION
#define XSPAN_CONFIG_ENABLE_IMPLICIT_CONVERSION 0
#endif
// allow automatic conversion PtrOrSpanOrNull => PtrOrSpan => Span (with run-time checks)
// choose between compile-time safety vs. possible run-time exceptions
// Allow automatic conversion PtrOrSpanOrNull => PtrOrSpan => Span (with run-time checks).
// Choose between compile-time safety vs. possible run-time exceptions.
#ifndef XSPAN_CONFIG_ENABLE_SPAN_CONVERSION
#define XSPAN_CONFIG_ENABLE_SPAN_CONVERSION 1
#endif
+2 -2
View File
@@ -62,7 +62,7 @@
#endif
/*************************************************************************
// util
// file util
**************************************************************************/
namespace {
@@ -100,7 +100,7 @@ static void set_fd_timestamp(int fd, const XStat *xst) noexcept {
BOOL r = SetFileTime((HANDLE) _get_osfhandle(fd), nullptr, &xst->ft_atime, &xst->ft_mtime);
IGNORE_ERROR(r);
#elif USE_FTIME
auto ft_ftime = xst->ft_ftime; // djgpp2 libc bug: not const, so use a copy
struct ftime ft_ftime = xst->ft_ftime; // djgpp2 libc bug/feature: not const, so use a copy
int r = setftime(fd, &ft_ftime);
IGNORE_ERROR(r);
#elif USE__FUTIME