File tree Expand file tree Collapse file tree 4 files changed +11
-12
lines changed Expand file tree Collapse file tree 4 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 1
1
#[=============================================================================[
2
2
Check whether write(2) can successfully write to stdout.
3
-
4
3
On Windows, _write() (and its deprecated alias write()) can also write to stdout
5
- but this PHP code uses this for POSIX targets only.
4
+ but PHP code uses this for POSIX targets only.
6
5
7
6
Result/cache variables:
8
7
9
- * PHP_WRITE_STDOUT - Whether 'write()' can write to stdout.
8
+ * PHP_WRITE_STDOUT
10
9
#]=============================================================================]
11
10
12
11
include (CheckIncludeFiles )
13
12
include (CheckSourceRuns )
14
13
include (CMakePushCheckState )
15
14
16
- # On Windows below check succeeds, however PHP implementation has it disabled.
17
15
if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
18
16
set (PHP_WRITE_STDOUT FALSE )
19
17
return ()
@@ -49,12 +47,17 @@ cmake_push_check_state(RESET)
49
47
# include <unistd.h>
50
48
#endif
51
49
50
+ #ifdef _WIN32
51
+ # include <io.h>
52
+ # undef write
53
+ # define write _write
54
+ #endif
55
+
52
56
#define TEXT "This is the test message -- "
53
57
54
58
int main(void)
55
59
{
56
60
int n;
57
-
58
61
n = write(1, TEXT, sizeof(TEXT)-1);
59
62
return (!(n == sizeof(TEXT)-1));
60
63
}
Original file line number Diff line number Diff line change @@ -88,7 +88,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
88
88
set (HAVE_IF_NAMETOINDEX FALSE )
89
89
set (HAVE_IFADDRS_H FALSE )
90
90
set (HAVE_IMMINTRIN_H TRUE )
91
- set (HAVE_IO_H TRUE )
92
91
set (HAVE_ISSETUGID FALSE )
93
92
set (HAVE_KILL FALSE )
94
93
set (HAVE_LANGINFO_H FALSE )
Original file line number Diff line number Diff line change 1
- /* Define to 1 if you have the <io.h> header file. */
2
- #cmakedefine HAVE_IO_H 1
3
-
4
1
/* Define to 1 if you have the <timelib_config.h> header file. */
5
2
#cmakedefine HAVE_TIMELIB_CONFIG_H 1
Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ project(
35
35
VERSION ${timelib_VERSION}
36
36
)
37
37
38
- include (CheckIncludeFiles )
39
-
40
38
if (NOT TIMELIB_TARGET )
41
39
set (TIMELIB_TARGET timelib )
42
40
add_library (${TIMELIB_TARGET} )
@@ -82,7 +80,9 @@ target_compile_definitions(
82
80
HAVE_STRTOLL
83
81
)
84
82
85
- check_include_files (io.h HAVE_IO_H )
83
+ if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
84
+ set (HAVE_IO_H TRUE )
85
+ endif ()
86
86
87
87
cmake_path (
88
88
RELATIVE_PATH
You can’t perform that action at this time.
0 commit comments