From fb950d69c91194cde5d4cf0b523661e01bc518ac Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 1 Nov 2022 20:20:44 +0530 Subject: [PATCH] zconf.h: Check that HAVE_UNISTD_H is not 0 Also do the same check for HAVE_STDARG_H. Some projects such as ffmpeg will use 1/0 to denote presence/absence instead of define/undef. --- zconf.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/zconf.h b/zconf.h index 5e1d68a..148d0a6 100644 --- a/zconf.h +++ b/zconf.h @@ -431,12 +431,20 @@ typedef uLong FAR uLongf; typedef unsigned long z_crc_t; #endif -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H +/* may be just defined without a value, or defined to 1, so handle both */ +#define Z_EXPAND(macro_or_string) Z_EXPAND_ARG (macro_or_string) +#define Z_EXPAND_ARG(contents) 1 ## contents + +#ifdef HAVE_UNISTD_H +# if Z_EXPAND(HAVE_UNISTD_H) != 10 +# define Z_HAVE_UNISTD_H +# endif #endif -#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_STDARG_H +#ifdef HAVE_STDARG_H +# if Z_EXPAND(HAVE_STDARG_H) != 10 +# define Z_HAVE_STDARG_H +# endif #endif #ifdef STDC -- 2.37.3