]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Added preprocessor error guards to ensure proper library usage.
authorNathan Moinvaziri <nathan@nathanm.com>
Thu, 18 Mar 2021 04:19:18 +0000 (21:19 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 18 Mar 2021 21:51:59 +0000 (22:51 +0100)
zlib-ng.h
zlib.h

index 384e3e2e3ddee3d035d9c997beaac561945e386d..b67f8c29a939f257025334f2b8cb9d7697ad997a 100644 (file)
--- a/zlib-ng.h
+++ b/zlib-ng.h
   (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 <stdint.h>
 #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 ce7306301e513c6a0c3679f30a8b64a6b171c3e8..a47809f858ca013a896ea745d49e105e828e8539 100644 (file)
--- a/zlib.h
+++ b/zlib.h
   (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 <stdint.h>
 #include <stdarg.h>
 #include "zconf.h"
 
+#ifndef ZCONF_H
+#  error Missing zconf.h add binary output directory to include directories
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif