Use exehead's my_GlobalAlloc

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1155 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
eccles 2002-09-22 20:02:03 +00:00
parent 93262d1d00
commit f97b2f81f7
2 changed files with 27 additions and 17 deletions

View file

@ -17,16 +17,16 @@
1. Redistributions of source code must retain the above copyright 1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer. notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must 2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product software in a product, an acknowledgment in the product
documentation would be appreciated but is not required. documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must 3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software. not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote 4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written products derived from this software without specific prior written
permission. permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
@ -85,7 +85,7 @@ typedef unsigned short UInt16;
#ifndef __GNUC__ #ifndef __GNUC__
#define __inline__ /* */ #define __inline__ /* */
#endif #endif
#define AssertD(cond,msg) /* */ #define AssertD(cond,msg) /* */
#define AssertH(cond,errcode) /* */ #define AssertH(cond,errcode) /* */
@ -98,7 +98,12 @@ typedef unsigned short UInt16;
#define VPrintf5(zf,za1,za2,za3,za4,za5) /* */ #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) #define BZALLOC(items) GlobalAlloc(GPTR,items)
#endif // def EXEHEAD
#define BZFREE(addr) { if (addr) GlobalFree(addr); } #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. --*/ /*-- externs for compression. --*/
extern void extern void
BZ2_blockSort ( EState* ); BZ2_blockSort ( EState* );
extern void extern void
BZ2_compressBlock ( EState*, Bool ); BZ2_compressBlock ( EState*, Bool );
extern void extern void
BZ2_bsInitWrite ( EState* ); BZ2_bsInitWrite ( EState* );
extern void extern void
BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 ); BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 );
extern void extern void
BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 ); BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 );
@ -396,7 +401,7 @@ typedef
Int32 save_N; Int32 save_N;
Int32 save_curr; Int32 save_curr;
Int32 save_zt; Int32 save_zt;
Int32 save_zn; Int32 save_zn;
Int32 save_zvec; Int32 save_zvec;
Int32 save_zj; Int32 save_zj;
Int32 save_gSel; Int32 save_gSel;
@ -446,13 +451,13 @@ typedef
/*-- externs for decompression. --*/ /*-- externs for decompression. --*/
extern Int32 extern Int32
BZ2_indexIntoF ( Int32, Int32* ); BZ2_indexIntoF ( Int32, Int32* );
extern Int32 extern Int32
BZ2_decompress ( DState* ); BZ2_decompress ( DState* );
extern void extern void
BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,
Int32, Int32, Int32 ); Int32, Int32, Int32 );

View file

@ -8,7 +8,7 @@
subject to change. Applications should only use zlib.h. 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 #ifndef _Z_UTIL_H
#define _Z_UTIL_H #define _Z_UTIL_H
@ -60,7 +60,12 @@ typedef unsigned long ulg;
# define Tracec(c,x) # define Tracec(c,x)
# define Tracecv(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)) #define ZALLOC(strm, items, size) GlobalAlloc(GPTR,(items)*(size))
#endif // def EXEHEAD
#define ZFREE(strm, addr) { if (addr) GlobalFree(addr); } #define ZFREE(strm, addr) { if (addr) GlobalFree(addr); }
#define TRY_FREE(s, p) { ZFREE(s, p); } #define TRY_FREE(s, p) { ZFREE(s, p); }
#define ERR_RETURN(strm,err) return (err) #define ERR_RETURN(strm,err) return (err)