]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix compilation on OpenBSD
authorBenjamin Stürz <benni@stuerz.xyz>
Sun, 9 Apr 2023 16:02:04 +0000 (18:02 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 15 Apr 2023 13:23:16 +0000 (15:23 +0200)
Non-POSIX functions (like vasprintf() and swap16()) require
_BSD_SOURCE to be defined.

Signed-off-by: Benjamin Stürz <benni@stuerz.xyz>
zbuild.h

index 922b2cae2cf808b6715a6e65c7d2d6b1921ddc4e..27f784a99f152fe866880e799283d32ca8e95a0a 100644 (file)
--- a/zbuild.h
+++ b/zbuild.h
@@ -8,6 +8,9 @@
 #ifndef _ISOC11_SOURCE
 #  define _ISOC11_SOURCE 1 /* aligned_alloc */
 #endif
+#ifdef __OpenBSD__
+#  define _BSD_SOURCE 1
+#endif
 
 #include <stddef.h>
 #include <string.h>