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)
98
98
include (CheckCSourceCompiles )
99
99
include (CheckCSourceRuns )
100
100
include (CheckSymbolExists )
101
- CHECK_INCLUDE_FILE (stdbool .h HAVE_STDBOOL_H )
101
+ CHECK_INCLUDE_FILE (unistd .h HAVE_UNISTD_H )
102
102
CHECK_C_SOURCE_COMPILES (
103
103
"int main() { __builtin_expect(0,0); return 0; }"
104
104
HAVE___BUILTIN_EXPECT )
105
- CHECK_C_SOURCE_COMPILES ("
106
- int f(void) __attribute__ (());
107
- int main() { return 0; }
108
- " HAVE___ATTRIBUTE__ )
109
105
110
106
# Always compile with warnings
111
107
if (MSVC )
Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ include(CheckIncludeFile)
178
178
include (CheckCSourceCompiles )
179
179
include (CheckCSourceRuns )
180
180
include (CheckSymbolExists )
181
+ CHECK_INCLUDE_FILE (unistd.h HAVE_UNISTD_H )
181
182
CHECK_C_SOURCE_COMPILES (
182
183
"int main() { __builtin_expect(0,0); return 0; }"
183
184
HAVE___BUILTIN_EXPECT )
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ extern "C" {
11
11
typedef char bool ;
12
12
#endif
13
13
14
+ #cmakedefine HAVE_UNISTD_H
15
+
14
16
#cmakedefine HAVE___BUILTIN_EXPECT
15
17
16
18
#cmakedefine CMARK_THREADING
Original file line number Diff line number Diff line change @@ -15,6 +15,15 @@ extern "C" {
15
15
typedef char bool ;
16
16
#endif
17
17
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
+
18
27
#define HAVE___BUILTIN_EXPECT
19
28
20
29
#define CMARK_THREADING
Original file line number Diff line number Diff line change 5
5
6
6
#ifdef CMARK_THREADING
7
7
8
- #if __has_include ( < unistd . h > )
8
+ #ifdef HAVE_UNISTD_H
9
9
#include <unistd.h>
10
10
#endif
11
11
You can’t perform that action at this time.
0 commit comments