macOS10.13 SDK dispatch.h vs HAVE_UNISTD_H

usr/include/dispatch/dispatch.h has the following:


#if !defined(HAVE_UNISTD_H) || HAVE_UNISTD_H

#include <unistd.h>

#endif


But any code that tries to bring in dispatch.h without having defined HAVE_UNISTD_H gets an error:

/Applications/Xcode_9.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
                                            ^


Which makes sense as I think that #if is syntacticaly wrong in the case when HAVE_UNISTD_H is undefined.


And reading it it makes no sense anyway. Given what it seems to be doing its saying not to include unistd.h only in the case where HAVE_UNISTD_H is defined but is 0.

Agreed, I am also seeing this error, on my first build (of Python 3) with Xcode 9 when I only had HAVE_UNISTD_H defined, but not set to a value.

I have the same issue

macOS10.13 SDK dispatch.h vs HAVE_UNISTD_H
 
 
Q