mirror of https://github.com/madler/zlib
Prevent invalid inclusions when HAVE_* is set to 0.
When including zconf.h from an external project that already has HAVE_UNISTD_H declared to a non-empty define (in this case =0), the inclusion of unistd.h is incorrectly applied. This breaks inclusion of zlib in several projects on windows and other platforms without unistd.h. This patch changes behaviour so that HAVE_UNISTD_H is checked to see if it is defined as blank or not equal to '0' before inclusion of the header.
This commit is contained in:
parent
d71dc66fa8
commit
88baa583b9
|
@ -434,11 +434,19 @@ typedef uLong FAR uLongf;
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||
# define Z_HAVE_UNISTD_H
|
||||
# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
|
||||
# define Z_HAVE_UNISTD_H
|
||||
# elif HAVE_UNISTD_H != 0
|
||||
# define Z_HAVE_UNISTD_H
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||
# define Z_HAVE_STDARG_H
|
||||
# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
|
||||
# define Z_HAVE_STDARG_H
|
||||
# elif HAVE_STDARG_H != 0
|
||||
# define Z_HAVE_STDARG_H
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef STDC
|
||||
|
|
12
zconf.h.in
12
zconf.h.in
|
@ -432,11 +432,19 @@ typedef uLong FAR uLongf;
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||
# define Z_HAVE_UNISTD_H
|
||||
# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
|
||||
# define Z_HAVE_UNISTD_H
|
||||
# elif HAVE_UNISTD_H != 0
|
||||
# define Z_HAVE_UNISTD_H
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||
# define Z_HAVE_STDARG_H
|
||||
# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
|
||||
# define Z_HAVE_STDARG_H
|
||||
# elif HAVE_STDARG_H != 0
|
||||
# define Z_HAVE_STDARG_H
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef STDC
|
||||
|
|
Loading…
Reference in New Issue