Skip to content

Commit

Permalink
Added preprocessor error guards to ensure proper library usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoinvaz authored and Dead2 committed Mar 18, 2021
1 parent 9b2baa8 commit bc33b26
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions zlib-ng.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions zlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc33b26

Please sign in to comment.