From f97b2f81f710b3278f5a824ba898ab98f6c697b7 Mon Sep 17 00:00:00 2001 From: eccles Date: Sun, 22 Sep 2002 20:02:03 +0000 Subject: [PATCH] Use exehead's my_GlobalAlloc git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1155 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/bzip2/bzlib_private.h | 37 ++++++++++++++++++++---------------- Source/zlib/ZUTIL.H | 7 ++++++- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/Source/bzip2/bzlib_private.h b/Source/bzip2/bzlib_private.h index 31f0de0c..5f6e4f2a 100644 --- a/Source/bzip2/bzlib_private.h +++ b/Source/bzip2/bzlib_private.h @@ -17,16 +17,16 @@ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - 4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS @@ -85,7 +85,7 @@ typedef unsigned short UInt16; #ifndef __GNUC__ #define __inline__ /* */ -#endif +#endif #define AssertD(cond,msg) /* */ #define AssertH(cond,errcode) /* */ @@ -98,7 +98,12 @@ typedef unsigned short UInt16; #define VPrintf5(zf,za1,za2,za3,za4,za5) /* */ +#ifdef EXEHEAD +#include "../exehead/util.h" +#define BZALLOC(items) my_GlobalAlloc(items) +#else // def EXEHEAD #define BZALLOC(items) GlobalAlloc(GPTR,items) +#endif // def EXEHEAD #define BZFREE(addr) { if (addr) GlobalFree(addr); } @@ -161,7 +166,7 @@ extern Int16 BZ2_rNums[512]; } */ -#define BZ_UPDATE_CRC(crcVar,cha) +#define BZ_UPDATE_CRC(crcVar,cha) /* \ { \ @@ -262,19 +267,19 @@ typedef /*-- externs for compression. --*/ -extern void +extern void BZ2_blockSort ( EState* ); -extern void +extern void BZ2_compressBlock ( EState*, Bool ); -extern void +extern void BZ2_bsInitWrite ( EState* ); -extern void +extern void BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 ); -extern void +extern void BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 ); @@ -396,7 +401,7 @@ typedef Int32 save_N; Int32 save_curr; Int32 save_zt; - Int32 save_zn; + Int32 save_zn; Int32 save_zvec; Int32 save_zj; Int32 save_gSel; @@ -446,13 +451,13 @@ typedef /*-- externs for decompression. --*/ -extern Int32 +extern Int32 BZ2_indexIntoF ( Int32, Int32* ); -extern Int32 +extern Int32 BZ2_decompress ( DState* ); -extern void +extern void BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, Int32, Int32, Int32 ); diff --git a/Source/zlib/ZUTIL.H b/Source/zlib/ZUTIL.H index 573015b8..944e0db3 100644 --- a/Source/zlib/ZUTIL.H +++ b/Source/zlib/ZUTIL.H @@ -8,7 +8,7 @@ subject to change. Applications should only use zlib.h. */ -/* @(#) $Id$ */ +/* @(#) $Id: ZUTIL.H,v 1.1.1.1 2002/08/02 10:01:35 kichik Exp $ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H @@ -60,7 +60,12 @@ typedef unsigned long ulg; # define Tracec(c,x) # define Tracecv(c,x) +#ifdef EXEHEAD +#include "../exehead/util.h" +#define ZALLOC(strm, items, size) my_GlobalAlloc((items)*(size)) +#else // def EXEHEAD #define ZALLOC(strm, items, size) GlobalAlloc(GPTR,(items)*(size)) +#endif // def EXEHEAD #define ZFREE(strm, addr) { if (addr) GlobalFree(addr); } #define TRY_FREE(s, p) { ZFREE(s, p); } #define ERR_RETURN(strm,err) return (err)