Changeset View
Changeset View
Standalone View
Standalone View
contrib/zlib/zutil.h
Show All 20 Lines | |||||
#include "zlib.h" | #include "zlib.h" | ||||
#if defined(STDC) && !defined(Z_SOLO) | #if defined(STDC) && !defined(Z_SOLO) | ||||
# if !(defined(_WIN32_WCE) && defined(_MSC_VER)) | # if !(defined(_WIN32_WCE) && defined(_MSC_VER)) | ||||
# include <stddef.h> | # include <stddef.h> | ||||
# endif | # endif | ||||
# include <string.h> | # include <string.h> | ||||
# if !(defined(MY_ZCALLOC)) | |||||
# include <stdlib.h> | # include <stdlib.h> | ||||
#endif | # endif | ||||
#endif | |||||
#ifdef Z_SOLO | #ifdef Z_SOLO | ||||
typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ | typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ | ||||
#endif | #endif | ||||
#ifndef local | #ifndef local | ||||
# define local static | # define local static | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | |||||
# define Assert(cond,msg) | # define Assert(cond,msg) | ||||
# define Trace(x) | # define Trace(x) | ||||
# define Tracev(x) | # define Tracev(x) | ||||
# define Tracevv(x) | # define Tracevv(x) | ||||
# define Tracec(c,x) | # define Tracec(c,x) | ||||
# define Tracecv(c,x) | # define Tracecv(c,x) | ||||
#endif | #endif | ||||
#ifndef Z_SOLO | #if !defined(Z_SOLO) || defined(MY_ZCALLOC) | ||||
voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, | voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, | ||||
unsigned size)); | unsigned size)); | ||||
void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); | void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); | ||||
#endif | #endif | ||||
#define ZALLOC(strm, items, size) \ | #define ZALLOC(strm, items, size) \ | ||||
(*((strm)->zalloc))((strm)->opaque, (items), (size)) | (*((strm)->zalloc))((strm)->opaque, (items), (size)) | ||||
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) | #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) | ||||
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} | #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} | ||||
/* Reverse the bytes in a 32-bit value */ | /* Reverse the bytes in a 32-bit value */ | ||||
#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ | #define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ | ||||
(((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) | (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) | ||||
#endif /* ZUTIL_H */ | #endif /* ZUTIL_H */ |