From bc33b26ca5391eb6b2c952cd032920033be27a53 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Wed, 17 Mar 2021 21:19:18 -0700 Subject: [PATCH] Added preprocessor error guards to ensure proper library usage. --- zlib-ng.h | 8 ++++++++ zlib.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/zlib-ng.h b/zlib-ng.h index 384e3e2e..b67f8c29 100644 --- a/zlib-ng.h +++ b/zlib-ng.h @@ -29,9 +29,17 @@ (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). */ +#ifdef ZLIB_H_ +# error Include zlib-ng.h for zlib-ng API or zlib.h for zlib-compat API but not both +#endif + #include #include "zconf-ng.h" +#ifndef ZCONFNG_H +# error Missing zconf-ng.h add binary output directory to include directories +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/zlib.h b/zlib.h index ce730630..a47809f8 100644 --- a/zlib.h +++ b/zlib.h @@ -30,10 +30,18 @@ (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). */ +#ifdef ZNGLIB_H_ +# error Include zlib-ng.h for zlib-ng API or zlib.h for zlib-compat API but not both +#endif + #include #include #include "zconf.h" +#ifndef ZCONF_H +# error Missing zconf.h add binary output directory to include directories +#endif + #ifdef __cplusplus extern "C" { #endif -- 2.47.3