workaround for conflisct with clang/unistd.h

This commit is contained in:
Richard Frith-Macdonald 2020-02-08 16:37:42 +00:00
parent 4b5594c63d
commit 0cd9843f5f
4 changed files with 16 additions and 3 deletions

View file

@ -28,11 +28,17 @@
#include <Foundation/NSObject.h>
#include <Foundation/NSError.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> // for gid_t and uid_t
/* Some versions of unistd.h use __block, but that's a reserved word
* for Clang so we temporarily redefine it while including the file.
*/
#ifdef __block
#undef __block
#endif
#define __block __gs_unistd_block
#include <unistd.h> // for gid_t and uid_t
#undef __block
#if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST)