Skip to content

Commit

Permalink
fix for preprocessor namespace pollution
Browse files Browse the repository at this point in the history
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
  • Loading branch information
matbech committed Oct 30, 2015
1 parent b971b6c commit 596ea9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 596ea9e

Please sign in to comment.