macOS: add a workaround to build with newer SDKs
authorBernhard Miklautz <bernhard.miklautz@shacknet.at>
Sat, 23 Sep 2017 11:31:34 +0000 (13:31 +0200)
committerBernhard Miklautz <bernhard.miklautz@shacknet.at>
Sat, 23 Sep 2017 12:13:30 +0000 (14:13 +0200)
SDK 10.13 (and possibly olders as well) need HAVE_UNISTD_H to be set to
a value if available otherwise the following error is thrown:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/dispatch/dispatch.h:38:45:
 error: expected value in expression #if !defined(HAVE_UNISTD_H) || HAVE_UNISTD_H

config.h.in

index b634b53..f6850c8 100644 (file)
@@ -3,7 +3,11 @@
 
 /* Include files */
 #cmakedefine HAVE_FCNTL_H
+#if defined(__APPLE__) && !defined(__IOS__)
+#cmakedefine01 HAVE_UNISTD_H
+#else
 #cmakedefine HAVE_UNISTD_H
+#endif
 #cmakedefine HAVE_INTTYPES_H
 #cmakedefine HAVE_SYS_MODEM_H
 #cmakedefine HAVE_SYS_FILIO_H