]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
fix for preprocessor namespace pollution 54/head
authorMat <mberchtold@gmail.com>
Fri, 30 Oct 2015 09:39:02 +0000 (10:39 +0100)
committerMat <mberchtold@gmail.com>
Fri, 30 Oct 2015 09:39:02 +0000 (10:39 +0100)
Do not pollute the namespace with a define for byte. This breaks various things. Instead use typedef which was also used in the original version of zlib.conf:

#if !defined(__MACTYPES__)
typedef unsigned char  Byte;  /* 8 bits */
#endif
typedef unsigned int   uInt;  /* 16 bits or more */
typedef unsigned long  uLong; /* 32 bits or more */

#ifdef SMALL_MEDIUM
   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
#  define Bytef Byte FAR
#else
   typedef Byte  FAR Bytef;
#endif

zconf.h.in

index 74c773c1e35b0daf8b13f83c8f8dd71174b4d2b6..55488afa5b734bc4afcb439d5e0fed6fb6b2886c 100644 (file)
@@ -92,8 +92,8 @@
 #endif
 
 /* Fallback for something that includes us. */
-#define Byte unsigned char
-#define Bytef unsigned char
+typedef unsigned char Byte;
+typedef Byte Bytef;
 
 typedef unsigned int   uInt;  /* 16 bits or more */
 typedef unsigned long  uLong; /* 32 bits or more */