File tree Expand file tree Collapse file tree 5 files changed +14
-6
lines changed Expand file tree Collapse file tree 5 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -98,14 +98,10 @@ include(CheckIncludeFile)
9898include (CheckCSourceCompiles)
9999include (CheckCSourceRuns)
100100include (CheckSymbolExists)
101- CHECK_INCLUDE_FILE(stdbool .h HAVE_STDBOOL_H )
101+ CHECK_INCLUDE_FILE(unistd .h HAVE_UNISTD_H )
102102CHECK_C_SOURCE_COMPILES(
103103 "int main() { __builtin_expect(0,0); return 0; }"
104104 HAVE___BUILTIN_EXPECT)
105- CHECK_C_SOURCE_COMPILES("
106- int f(void) __attribute__ (());
107- int main() { return 0; }
108- " HAVE___ATTRIBUTE__)
109105
110106# Always compile with warnings
111107if (MSVC )
Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ include(CheckIncludeFile)
178178include (CheckCSourceCompiles)
179179include (CheckCSourceRuns)
180180include (CheckSymbolExists)
181+ CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
181182CHECK_C_SOURCE_COMPILES(
182183 "int main() { __builtin_expect(0,0); return 0; }"
183184 HAVE___BUILTIN_EXPECT)
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ extern "C" {
1111 typedef char bool ;
1212#endif
1313
14+ #cmakedefine HAVE_UNISTD_H
15+
1416#cmakedefine HAVE___BUILTIN_EXPECT
1517
1618#cmakedefine CMARK_THREADING
Original file line number Diff line number Diff line change @@ -15,6 +15,15 @@ extern "C" {
1515 typedef char bool ;
1616#endif
1717
18+ #if defined(__has_include )
19+ # if __has_include (< unistd .h > )
20+ # define HAVE_UNISTD_H
21+ # endif
22+ #elif defined(unix ) || defined(__unix__ ) || defined(__unix ) || defined(__APPLE__ )
23+ // Apple Clang does not define any of the unix symbols, even though it provides unistd.h
24+ # define HAVE_UNISTD_H
25+ #endif
26+
1827#define HAVE___BUILTIN_EXPECT
1928
2029#define CMARK_THREADING
Original file line number Diff line number Diff line change 55
66#ifdef CMARK_THREADING
77
8- #if __has_include ( < unistd . h > )
8+ #ifdef HAVE_UNISTD_H
99#include <unistd.h>
1010#endif
1111
You can’t perform that action at this time.
0 commit comments