mirror of https://github.com/upx/upx.git
CI: update
This commit is contained in:
parent
fc4dcd46db
commit
161d20e614
|
@ -12,8 +12,8 @@ env:
|
|||
CMAKE_REQUIRED_QUIET: OFF
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
UPX_CMAKE_BUILD_FLAGS: --verbose
|
||||
# 2023-07-20
|
||||
ZIG_DIST_VERSION: 0.11.0-dev.4059+17255bed4
|
||||
# 2023-07-24
|
||||
ZIG_DIST_VERSION: 0.11.0-dev.4195+7f3fdd2ff
|
||||
|
||||
jobs:
|
||||
job-rebuild-and-verify-stubs:
|
||||
|
@ -333,8 +333,8 @@ jobs:
|
|||
cat .GITREV.txt
|
||||
set /p GITREV=<.GITREV.txt
|
||||
set UPX_DEFS=-DUPX_CONFIG_DISABLE_WSTRICT=0 -DUPX_CONFIG_DISABLE_WERROR=0 -DWITH_BZIP2=0 -DWITH_ZSTD=0
|
||||
set UPX_LIBS=%BDIR%\bzip2\bzip2.lib %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib %BDIR%\zstd\zstd.lib
|
||||
set UPX_LIBS=%BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib
|
||||
@rem set UPX_LIBS=%BDIR%\bzip2\bzip2.lib %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib %BDIR%\zstd\zstd.lib
|
||||
set sources=%s%\*.cpp %s%\check\*.cpp %s%\compress\*.cpp %s%\console\*.cpp %s%\filter\*.cpp %s%\util\*.cpp
|
||||
%RUN_CL% -J -O2 -W4 -WX -std:c++17 -Zc:__cplusplus -EHsc -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% %UPX_DEFS% -I%H%\vendor -Feupx.exe %sources% %UPX_LIBS% /link ${{ matrix.link_machine_flags }} setargv.obj
|
||||
- name: 'Make artifact'
|
||||
|
@ -389,6 +389,7 @@ jobs:
|
|||
# { zig_target: aarch64-macos.12.0-none }
|
||||
# { zig_target: aarch64-macos.13.0-none }
|
||||
- { zig_target: aarch64-windows-gnu }
|
||||
- { zig_target: arm-linux-musleabihf }
|
||||
# { zig_target: i386-linux-musl }
|
||||
- { zig_target: i386-windows-gnu }
|
||||
# { zig_target: mips-linux-musl }
|
||||
|
|
|
@ -8,8 +8,8 @@ on:
|
|||
env:
|
||||
CMAKE_REQUIRED_QUIET: OFF
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
# 2023-07-20
|
||||
ZIG_DIST_VERSION: 0.11.0-dev.4059+17255bed4
|
||||
# 2023-07-24
|
||||
ZIG_DIST_VERSION: 0.11.0-dev.4195+7f3fdd2ff
|
||||
|
||||
jobs:
|
||||
job-linux-zigcc: # uses cmake + make
|
||||
|
@ -27,6 +27,7 @@ jobs:
|
|||
- { zig_target: aarch64-macos.12.0-none }
|
||||
- { zig_target: aarch64-macos.13.0-none }
|
||||
- { zig_target: aarch64-windows-gnu }
|
||||
- { zig_target: arm-linux-musleabihf }
|
||||
- { zig_target: i386-linux-musl }
|
||||
- { zig_target: i386-windows-gnu }
|
||||
- { zig_target: mips-linux-musl }
|
||||
|
|
24
src/conf.h
24
src/conf.h
|
@ -386,31 +386,9 @@ struct UnsignedSizeOf {
|
|||
};
|
||||
#define usizeof(expr) (UnsignedSizeOf<sizeof(expr)>::value)
|
||||
|
||||
// simple pointer type alias to explicitly mark ownership of objects; purely
|
||||
// cosmetic to improve source code readability, no real functionality
|
||||
#if 0
|
||||
#define OwningPointer(T) T *
|
||||
#else
|
||||
template <class T> using OwningPointer = T *;
|
||||
#define OwningPointer(T) OwningPointer<T>
|
||||
#endif
|
||||
template <class T>
|
||||
inline void owner_delete(OwningPointer(T) (&object)) noexcept {
|
||||
static_assert(std::is_class_v<T>);
|
||||
static_assert(std::is_nothrow_destructible_v<T>);
|
||||
delete object;
|
||||
object = nullptr;
|
||||
}
|
||||
#if defined(__clang__) || __GNUC__ != 7
|
||||
template <class T>
|
||||
inline void owner_delete(T (&array)[]) noexcept DELETED_FUNCTION;
|
||||
#endif
|
||||
template <class T, size_t N>
|
||||
inline void owner_delete(T (&array)[N]) noexcept DELETED_FUNCTION;
|
||||
|
||||
template <class T>
|
||||
inline void mem_clear(T *object) noexcept {
|
||||
static_assert(std::is_class_v<T>);
|
||||
static_assert(std::is_class_v<T>); // UPX convention
|
||||
static_assert(std::is_standard_layout_v<T>);
|
||||
static_assert(std::is_trivially_copyable_v<T>);
|
||||
constexpr size_t size = sizeof(*object);
|
||||
|
|
|
@ -48,6 +48,7 @@ Packer::~Packer() noexcept {
|
|||
// owner
|
||||
owner_delete(uip);
|
||||
owner_delete(linker);
|
||||
assert_noexcept(linker == nullptr);
|
||||
// references
|
||||
bele = nullptr;
|
||||
fi = nullptr;
|
||||
|
|
|
@ -130,6 +130,70 @@ void upx_memswap(void *a, void *b, size_t n);
|
|||
void upx_stable_sort(void *array, size_t n, size_t element_size,
|
||||
int (*compare)(const void *, const void *));
|
||||
|
||||
/*************************************************************************
|
||||
// OwningPointer(T)
|
||||
// simple pointer type alias to explicitly mark ownership of objects; purely
|
||||
// cosmetic to improve source code readability, no real functionality
|
||||
**************************************************************************/
|
||||
|
||||
#if 0
|
||||
|
||||
// this works
|
||||
#define OwningPointer(T) T *
|
||||
|
||||
#elif 1
|
||||
|
||||
// this also works
|
||||
template <class T>
|
||||
using OwningPointer = T *;
|
||||
#define OwningPointer(T) OwningPointer<T>
|
||||
|
||||
#else
|
||||
|
||||
// simple class with just a number of no-ops
|
||||
template <class T>
|
||||
struct OwningPointer {
|
||||
static_assert(std::is_class_v<T>); // UPX convention
|
||||
typedef typename std::add_lvalue_reference<T>::type reference;
|
||||
typedef typename std::add_lvalue_reference<const T>::type const_reference;
|
||||
typedef typename std::add_pointer<T>::type pointer;
|
||||
typedef typename std::add_pointer<const T>::type const_pointer;
|
||||
pointer ptr;
|
||||
inline OwningPointer(pointer p) noexcept : ptr(p) {}
|
||||
inline operator pointer() noexcept { return ptr; }
|
||||
inline operator const_pointer() const noexcept { return ptr; }
|
||||
inline reference operator*() noexcept { return *ptr; }
|
||||
inline const_reference operator*() const noexcept { return *ptr; }
|
||||
inline pointer operator->() noexcept { return ptr; }
|
||||
inline const_pointer operator->() const noexcept { return ptr; }
|
||||
};
|
||||
// overload mem_clear()
|
||||
template <class T>
|
||||
inline void mem_clear(OwningPointer<T> object) noexcept {
|
||||
mem_clear((T *) object);
|
||||
}
|
||||
#define OwningPointer(T) OwningPointer<T>
|
||||
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
inline void owner_delete(OwningPointer(T)(&object)) noexcept {
|
||||
static_assert(std::is_class_v<T>); // UPX convention
|
||||
static_assert(std::is_nothrow_destructible_v<T>);
|
||||
if (object != nullptr) {
|
||||
delete (T *) object;
|
||||
object = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// disable some overloads
|
||||
#if defined(__clang__) || __GNUC__ != 7
|
||||
template <class T>
|
||||
inline void owner_delete(T (&array)[]) noexcept DELETED_FUNCTION;
|
||||
#endif
|
||||
template <class T, size_t N>
|
||||
inline void owner_delete(T (&array)[N]) noexcept DELETED_FUNCTION;
|
||||
|
||||
/*************************************************************************
|
||||
// misc. support functions
|
||||
**************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue