summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2021-03-17 21:19:18 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2021-03-18 22:51:59 +0100
commitbc33b26ca5391eb6b2c952cd032920033be27a53 (patch)
treec4d47a46b7c4864f2ebd0f9044db5e2d3ca5b8b9
parent9b2baa8217c31e869c0ba53bbb458cd3ef040d00 (diff)
Added preprocessor error guards to ensure proper library usage.
-rw-r--r--zlib-ng.h8
-rw-r--r--zlib.h8
2 files changed, 16 insertions, 0 deletions
diff --git a/zlib-ng.h b/zlib-ng.h
index 384e3e2..b67f8c2 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 <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 ce73063..a47809f 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 <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