From 828526a0012b0422e0c578f15be64bc76a3cb661 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 13 Nov 2000 10:43:01 +0000 Subject: [PATCH] Added symbol `__UPX_CHECKER' for memory checkers. committer: mfx 974112181 +0000 --- src/compress.cpp | 4 ++-- src/conf.h | 62 ++++++++++++++++++++++++++---------------------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/src/compress.cpp b/src/compress.cpp index ed2964e9..2e4054b5 100644 --- a/src/compress.cpp +++ b/src/compress.cpp @@ -147,7 +147,7 @@ int upx_compress ( const upx_byte *src, upx_uint src_len, if (method == M_NRV2B_LE32) { upx_byte wrkmem[NRV2B_1_16_MEM_COMPRESS]; -#if defined(__CHECKER__) || defined(__PURIFY__) +#if defined(__UPX_CHECKER) memset(wrkmem,0,NRV2B_1_16_MEM_COMPRESS); #endif r = nrv2b_1_16_compress(src, src_len, dst, dst_len, wrkmem); @@ -155,7 +155,7 @@ int upx_compress ( const upx_byte *src, upx_uint src_len, else if (method == M_NRV2D_LE32) { upx_byte wrkmem[NRV2D_1_16_MEM_COMPRESS]; -#if defined(__CHECKER__) || defined(__PURIFY__) +#if defined(__UPX_CHECKER) memset(wrkmem,0,NRV2D_1_16_MEM_COMPRESS); #endif r = nrv2d_1_16_compress(src, src_len, dst, dst_len, wrkmem); diff --git a/src/conf.h b/src/conf.h index bca513bb..02779e71 100644 --- a/src/conf.h +++ b/src/conf.h @@ -62,41 +62,43 @@ # include # include # if !defined(UPX_UINT_MAX) -# define UPX_UINT_MAX UCL_UINT_MAX -# define upx_uint ucl_uint -# define upx_voidp ucl_voidp -# define upx_uintp ucl_uintp -# define upx_byte ucl_byte -# define upx_bytep ucl_bytep -# define upx_bool ucl_bool -# define upx_progress_callback_t ucl_progress_callback_t -# define upx_adler32 ucl_adler32 -# define UPX_E_OK UCL_E_OK -# define UPX_E_ERROR UCL_E_ERROR -# define UPX_E_OUT_OF_MEMORY UCL_E_OUT_OF_MEMORY -# define __UPX_ENTRY __UCL_ENTRY +# define UPX_UINT_MAX UCL_UINT_MAX +# define upx_uint ucl_uint +# define upx_voidp ucl_voidp +# define upx_uintp ucl_uintp +# define upx_byte ucl_byte +# define upx_bytep ucl_bytep +# define upx_bool ucl_bool +# define upx_progress_callback_t ucl_progress_callback_t +# define upx_adler32 ucl_adler32 +# define UPX_E_OK UCL_E_OK +# define UPX_E_ERROR UCL_E_ERROR +# define UPX_E_OUT_OF_MEMORY UCL_E_OUT_OF_MEMORY +# define __UPX_ENTRY __UCL_ENTRY # endif #endif #if defined(WITH_NRV) # include # if !defined(UPX_UINT_MAX) -# define UPX_UINT_MAX NRV_UINT_MAX -# define upx_uint nrv_uint -# define upx_voidp nrv_voidp -# define upx_uintp nrv_uintp -# define upx_byte nrv_byte -# define upx_bytep nrv_bytep -# define upx_bool nrv_bool -# define upx_progress_callback_t nrv_progress_callback_t -# define upx_adler32 nrv_adler32 -# define UPX_E_OK NRV_E_OK -# define UPX_E_ERROR NRV_E_ERROR -# define UPX_E_OUT_OF_MEMORY NRV_E_OUT_OF_MEMORY -# define __UPX_ENTRY __NRV_ENTRY +# define UPX_UINT_MAX NRV_UINT_MAX +# define upx_uint nrv_uint +# define upx_voidp nrv_voidp +# define upx_uintp nrv_uintp +# define upx_byte nrv_byte +# define upx_bytep nrv_bytep +# define upx_bool nrv_bool +# define upx_progress_callback_t nrv_progress_callback_t +# define upx_adler32 nrv_adler32 +# define UPX_E_OK NRV_E_OK +# define UPX_E_ERROR NRV_E_ERROR +# define UPX_E_OUT_OF_MEMORY NRV_E_OUT_OF_MEMORY +# define __UPX_ENTRY __NRV_ENTRY # endif #endif -#ifndef WITH_ZLIB -# define WITH_ZLIB 1 +#if !defined(__UPX_CHECKER) +# if defined(__UCL_CHECKER) || defined(__NRV_CHECKER) +# define __UPX_CHECKER +# endif #endif #if !defined(UPX_UINT_MAX) || (UINT_MAX < 0xffffffffL) # error "you lose" @@ -108,6 +110,10 @@ # error "please upgrade your UCL installation" #endif +#ifndef WITH_ZLIB +# define WITH_ZLIB 1 +#endif + /************************************************************************* // system includes