Skip to content

Commit

Permalink
improve logic on variants of ZLIB_H
Browse files Browse the repository at this point in the history
  • Loading branch information
Coeur authored and nmoinvaz committed Nov 11, 2024
1 parent 6a1a1ee commit 5221967
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions compat/crypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@
Encryption is not supported.
*/

#ifndef _ZLIB_H
# ifndef ZLIB_VERNUM
#ifndef ZLIB_VERNUM
/* No zlib */
typedef uint32_t z_crc_t;
# elif (ZLIB_VERNUM & 0xf != 0xf) && (ZLIB_VERNUM < 0x1270)
#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)
#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
#endif

#define CRC32(c, b) ((*(pcrc_32_tab + (((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
Expand Down
8 changes: 4 additions & 4 deletions compat/ioapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

#include <stdint.h>

#ifndef _ZLIB_H
# if __has_include(<zlib.h>)
# include <zlib.h>
# elif __has_include(<zlib-ng.h>)
#if !defined(_ZLIB_H) && !defined(ZLIB_H) && !defined(ZLIB_H_)
# if __has_include(<zlib-ng.h>)
# include <zlib-ng.h>
# elif __has_include(<zlib.h>)
# include <zlib.h>
# endif
#endif

Expand Down

0 comments on commit 5221967

Please sign in to comment.