]> 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-git@circlestorm.org>
Sun, 16 Apr 2023 10:42:46 +0000 (12:42 +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 17f98101a43dc7f29d836317dde0fccc173baf8d..4fe9d5f64e3a9b14d59dc5a3ce8848052cba142a 100644 (file)
--- a/zbuild.h
+++ b/zbuild.h
@@ -4,6 +4,9 @@
 #ifndef _ISOC11_SOURCE
 #  define _ISOC11_SOURCE 1 /* aligned_alloc */
 #endif
+#ifdef __OpenBSD__
+#  define _BSD_SOURCE 1
+#endif
 
 /* This has to be first include that defines any types */
 #if defined(_MSC_VER)