mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Small cleanups.
committer: mfx <mfx> 1058967699 +0000
This commit is contained in:
parent
4205c699ac
commit
ed0e3b9af4
|
@ -490,6 +490,7 @@ ifeq ($(DEBUG),1)
|
|||
else
|
||||
CFLAGS += -O1 -GF
|
||||
LINK_EXE_LDFLAGS += /release
|
||||
##LINK_EXE_LDFLAGS += /opt:nowin98
|
||||
endif
|
||||
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#ifndef __ACC_H_INCLUDED
|
||||
#define __ACC_H_INCLUDED
|
||||
|
||||
#define ACC_VERSION 20030720L
|
||||
#define ACC_VERSION 20030722L
|
||||
|
||||
#if !defined(ACC_CONFIG_INCLUDE)
|
||||
# define ACC_CONFIG_INCLUDE(file) file
|
||||
|
|
|
@ -112,6 +112,9 @@
|
|||
# else
|
||||
ACCCHK_ASSERT(sizeof('\0') == sizeof(int))
|
||||
# endif
|
||||
#endif
|
||||
#if defined(acc_alignof)
|
||||
ACCCHK_ASSERT(acc_alignof(char) == 1)
|
||||
#endif
|
||||
|
||||
ACCCHK_ASSERT_IS_SIGNED(short)
|
||||
|
|
|
@ -126,6 +126,19 @@
|
|||
#endif
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
//
|
||||
************************************************************************/
|
||||
|
||||
#if (ACC_CC_GNUC)
|
||||
# define acc_alignof(e) __alignof__(e)
|
||||
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 700))
|
||||
# define acc_alignof(e) __alignof__(e)
|
||||
#elif (ACC_CC_MSC && (_MSC_VER >= 1300))
|
||||
# define acc_alignof(e) __alignof(e)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
vi:ts=4:et
|
||||
|
|
45
src/main.cpp
45
src/main.cpp
|
@ -1013,26 +1013,26 @@ void upx_sanity_check(void)
|
|||
{
|
||||
#include "acc/acc_chk.ch"
|
||||
|
||||
COMPILE_TIME_ASSERT(sizeof(char) == 1);
|
||||
COMPILE_TIME_ASSERT(sizeof(short) == 2);
|
||||
COMPILE_TIME_ASSERT(sizeof(int) == 4);
|
||||
COMPILE_TIME_ASSERT(sizeof(long) >= 4);
|
||||
COMPILE_TIME_ASSERT(sizeof(void *) >= 4);
|
||||
COMPILE_TIME_ASSERT(sizeof(long) >= sizeof(void *));
|
||||
COMPILE_TIME_ASSERT(sizeof(char) == 1)
|
||||
COMPILE_TIME_ASSERT(sizeof(short) == 2)
|
||||
COMPILE_TIME_ASSERT(sizeof(int) == 4)
|
||||
COMPILE_TIME_ASSERT(sizeof(long) >= 4)
|
||||
COMPILE_TIME_ASSERT(sizeof(void *) >= 4)
|
||||
COMPILE_TIME_ASSERT(sizeof(long) >= sizeof(void *))
|
||||
|
||||
COMPILE_TIME_ASSERT(sizeof(off_t) >= sizeof(long));
|
||||
COMPILE_TIME_ASSERT(((off_t) -1) < 0);
|
||||
COMPILE_TIME_ASSERT(sizeof(off_t) >= sizeof(long))
|
||||
COMPILE_TIME_ASSERT(((off_t) -1) < 0)
|
||||
|
||||
COMPILE_TIME_ASSERT(sizeof(BE16) == 2);
|
||||
COMPILE_TIME_ASSERT(sizeof(BE32) == 4);
|
||||
COMPILE_TIME_ASSERT(sizeof(LE16) == 2);
|
||||
COMPILE_TIME_ASSERT(sizeof(LE32) == 4);
|
||||
COMPILE_TIME_ASSERT(sizeof(BE16) == 2)
|
||||
COMPILE_TIME_ASSERT(sizeof(BE32) == 4)
|
||||
COMPILE_TIME_ASSERT(sizeof(LE16) == 2)
|
||||
COMPILE_TIME_ASSERT(sizeof(LE32) == 4)
|
||||
|
||||
#if (ACC_CC_GNUC) || (ACC_CC_INTELC && __INTEL_COMPILER >= 700)
|
||||
COMPILE_TIME_ASSERT(__alignof__(BE16) == 1);
|
||||
COMPILE_TIME_ASSERT(__alignof__(BE32) == 1);
|
||||
COMPILE_TIME_ASSERT(__alignof__(LE16) == 1);
|
||||
COMPILE_TIME_ASSERT(__alignof__(LE32) == 1);
|
||||
#if defined(acc_alignof)
|
||||
COMPILE_TIME_ASSERT(acc_alignof(BE16) == 1)
|
||||
COMPILE_TIME_ASSERT(acc_alignof(BE32) == 1)
|
||||
COMPILE_TIME_ASSERT(acc_alignof(LE16) == 1)
|
||||
COMPILE_TIME_ASSERT(acc_alignof(LE32) == 1)
|
||||
#endif
|
||||
|
||||
#if !defined(ACC_CC_WATCOMC)
|
||||
|
@ -1048,13 +1048,13 @@ void upx_sanity_check(void)
|
|||
//printf("%d\n", (int) sizeof(align_assertion_1b_t));
|
||||
//printf("%d\n", (int) sizeof(align_assertion_2a_t));
|
||||
//printf("%d\n", (int) sizeof(align_assertion_2b_t));
|
||||
COMPILE_TIME_ASSERT(sizeof(align_assertion_1a_t) == sizeof(align_assertion_1b_t));
|
||||
COMPILE_TIME_ASSERT(sizeof(align_assertion_2a_t) == sizeof(align_assertion_2b_t));
|
||||
COMPILE_TIME_ASSERT(sizeof(align_assertion_1a_t) == 3*9);
|
||||
COMPILE_TIME_ASSERT(sizeof(align_assertion_2a_t) == 3*17);
|
||||
COMPILE_TIME_ASSERT(sizeof(align_assertion_1a_t) == sizeof(align_assertion_1b_t))
|
||||
COMPILE_TIME_ASSERT(sizeof(align_assertion_2a_t) == sizeof(align_assertion_2b_t))
|
||||
COMPILE_TIME_ASSERT(sizeof(align_assertion_1a_t) == 3*9)
|
||||
COMPILE_TIME_ASSERT(sizeof(align_assertion_2a_t) == 3*17)
|
||||
#endif
|
||||
|
||||
COMPILE_TIME_ASSERT(sizeof(UPX_VERSION_STRING4) == 4 + 1);
|
||||
COMPILE_TIME_ASSERT(sizeof(UPX_VERSION_STRING4) == 4 + 1)
|
||||
assert(strlen(UPX_VERSION_STRING4) == 4);
|
||||
assert(memcmp(UPX_VERSION_STRING4, UPX_VERSION_STRING, 4) == 0);
|
||||
|
||||
|
@ -1248,7 +1248,6 @@ int __acc_cdecl_main main(int argc, char *argv[])
|
|||
#if 0 && defined(__GLIBC__)
|
||||
//malloc_stats();
|
||||
#endif
|
||||
do_exit();
|
||||
return exit_code;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user