all: yet more minor cleanups
This commit is contained in:
+4
-3
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user