all: yet more minor cleanups

This commit is contained in:
Markus F.X.J. Oberhumer
2024-03-19 16:03:37 +01:00
parent 54d16a458a
commit a21a006fe9
10 changed files with 54 additions and 20 deletions
+4 -3
View File
@@ -145,13 +145,13 @@ typedef acc_int64_t upx_int64_t;
typedef acc_uint64_t upx_uint64_t;
typedef acc_uintptr_t upx_uintptr_t;
// convention: use "byte" when dealing with data; use "char/uchar" when dealing
// UPX convention: use "byte" when dealing with data; use "char/uchar" when dealing
// with strings; use "upx_uint8_t" when dealing with small integers
typedef unsigned char byte;
#define upx_byte byte
#define upx_bytep byte *
typedef unsigned char uchar;
// convention: use "charptr" when dealing with abstract pointer arithmetics
// UPX convention: use "charptr" when dealing with abstract pointer arithmetics
#define charptr upx_charptr_unit_type *
// upx_charptr_unit_type is some opaque type with sizeof(type) == 1
struct alignas(1) upx_charptr_unit_type final { char hidden__; };
@@ -192,7 +192,7 @@ typedef upx_int64_t upx_off_t;
#define very_unlikely __acc_very_unlikely
// cosmetic: explicitly annotate some functions which may throw exceptions
// note: noexcept(false) is the default for all C++ functions anyway
// note: noexcept(false) is the default for all C++ functions anyway
#define may_throw noexcept(false)
#define COMPILE_TIME_ASSERT(e) ACC_COMPILE_TIME_ASSERT(e)
@@ -230,6 +230,7 @@ typedef upx_int64_t upx_off_t;
#endif
#if defined(HAVE_DUP) && (HAVE_DUP + 0 == 0)
// TODO later: add upx_fd_dup() util
#undef dup
#define dup(x) (-1)
#endif
+2 -9
View File
@@ -62,12 +62,12 @@
#endif
// sanity checks
#if defined(__ILP32) || defined(__ILP32__)
#if defined(_ILP32) || defined(__ILP32) || defined(__ILP32__)
static_assert(sizeof(int) == 4);
static_assert(sizeof(long) == 4);
static_assert(sizeof(void *) == 4);
#endif
#if defined(__LP64) || defined(__LP64__)
#if defined(_LP64) || defined(__LP64) || defined(__LP64__)
static_assert(sizeof(int) == 4);
static_assert(sizeof(long) == 8);
static_assert(sizeof(void *) == 8);
@@ -153,13 +153,6 @@ static_assert(sizeof(void *) == sizeof(long));
// UPX vendor git submodule headers
#include <doctest/doctest/parts/doctest_fwd.h>
#if WITH_BOOST_PFR
#include <sstream>
#include <boost/pfr/io.hpp>
#endif
#if WITH_RANGELESS_FN
#include <rangeless/include/fn.hpp>
#endif
#ifndef WITH_VALGRIND
#define WITH_VALGRIND 1
#endif