From 9310a6552846d5e618280fa97c8ea81f38265728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C5=93ur?= Date: Fri, 1 Nov 2024 23:39:39 +0100 Subject: [PATCH] improve logic on variants of ZLIB_H --- compat/crypt.h | 20 +++++++++----------- compat/ioapi.h | 8 ++++---- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/compat/crypt.h b/compat/crypt.h index a20a7b81..ef7bc7ed 100644 --- a/compat/crypt.h +++ b/compat/crypt.h @@ -25,17 +25,15 @@ Encryption is not supported. */ -#ifndef _ZLIB_H -# ifndef ZLIB_VERNUM - /* No zlib */ - typedef uint32_t z_crc_t; -# elif (ZLIB_VERNUM & 0xf != 0xf) && (ZLIB_VERNUM < 0x1270) - /* Define z_crc_t in zlib 1.2.6 and less */ - typedef unsigned long z_crc_t; -# elif (ZLIB_VERNUM & 0xf == 0xf) && (ZLIB_VERNUM < 0x12df) - /* Define z_crc_t in zlib-ng 2.0.7 and less */ - typedef unsigned int z_crc_t; -# endif +#ifndef ZLIB_VERNUM + /* No zlib */ + typedef uint32_t z_crc_t; +#elif (ZLIB_VERNUM & 0xf != 0xf) && (ZLIB_VERNUM < 0x1270) + /* Define z_crc_t in zlib 1.2.6 and less */ + typedef unsigned long z_crc_t; +#elif (ZLIB_VERNUM & 0xf == 0xf) && (ZLIB_VERNUM < 0x12df) + /* Define z_crc_t in zlib-ng 2.0.7 and less */ + typedef unsigned int z_crc_t; #endif #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) diff --git a/compat/ioapi.h b/compat/ioapi.h index 88bf2c4b..634df858 100644 --- a/compat/ioapi.h +++ b/compat/ioapi.h @@ -4,11 +4,11 @@ #include -#ifndef _ZLIB_H -# if __has_include() -# include -# elif __has_include() +#if !defined(_ZLIB_H) && !defined(ZLIB_H) && !defined(ZLIB_H_) +# if __has_include() # include +# elif __has_include() +# include # endif #endif