Skip to content

Commit d54389e

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 5d7757b + d028366 commit d54389e

File tree

2 files changed

+60
-58
lines changed

2 files changed

+60
-58
lines changed

cmake/cmake/ConfigureChecks.cmake

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -133,31 +133,6 @@ cmake_pop_check_state()
133133
# Check types.
134134
################################################################################
135135

136-
check_type_size("int" SIZEOF_INT)
137-
if(NOT SIZEOF_INT)
138-
message(FATAL_ERROR "Cannot determine size of int.")
139-
endif()
140-
141-
check_type_size("long" SIZEOF_LONG)
142-
if(NOT SIZEOF_LONG)
143-
message(FATAL_ERROR "Cannot determine size of long.")
144-
endif()
145-
146-
check_type_size("long long" SIZEOF_LONG_LONG)
147-
if(NOT SIZEOF_LONG_LONG)
148-
message(FATAL_ERROR "Cannot determine size of long long.")
149-
endif()
150-
151-
check_type_size("size_t" SIZEOF_SIZE_T)
152-
if(NOT HAVE_SIZEOF_SIZE_T)
153-
message(FATAL_ERROR "Cannot determine size of size_t.")
154-
endif()
155-
156-
check_type_size("off_t" SIZEOF_OFF_T)
157-
if(NOT SIZEOF_OFF_T)
158-
message(FATAL_ERROR "Cannot determine size of off_t.")
159-
endif()
160-
161136
check_type_size("gid_t" SIZEOF_GID_T)
162137
if(NOT HAVE_SIZEOF_GID_T)
163138
set(
@@ -166,31 +141,46 @@ if(NOT HAVE_SIZEOF_GID_T)
166141
)
167142
endif()
168143

169-
check_type_size("uid_t" SIZEOF_UID_T)
170-
if(NOT HAVE_SIZEOF_UID_T)
171-
set(
172-
uid_t int
173-
CACHE INTERNAL "Define as 'int' if <sys/types.h> doesn't define."
174-
)
175-
endif()
144+
check_type_size("int" SIZEOF_INT)
176145

177146
check_type_size("intmax_t" SIZEOF_INTMAX_T)
178147
if(NOT SIZEOF_INTMAX_T)
179148
set(SIZEOF_INTMAX_T 0 CACHE INTERNAL "Size of intmax_t")
180149
message(WARNING "Couldn't determine size of intmax_t, setting to 0.")
150+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
151+
# PHP on Windows sets the SIZEOF_INTMAX_T to 0 to skip certain checks,
152+
# otherwise intmax_t and its size is available.
153+
set(SIZEOF_INTMAX_T 0 CACHE INTERNAL "Size of intmax_t")
181154
endif()
182155

183-
check_type_size("ssize_t" SIZEOF_SSIZE_T)
184-
if(NOT SIZEOF_SSIZE_T)
185-
set(SIZEOF_SSIZE_T 8 CACHE INTERNAL "Size of ssize_t")
186-
message(WARNING "Couldn't determine size of ssize_t, setting to 8.")
187-
endif()
156+
check_type_size("long" SIZEOF_LONG)
157+
check_type_size("long long" SIZEOF_LONG_LONG)
158+
check_type_size("off_t" SIZEOF_OFF_T)
188159

189160
check_type_size("ptrdiff_t" SIZEOF_PTRDIFF_T)
190161
set(HAVE_PTRDIFF_T 1 CACHE INTERNAL "Whether ptrdiff_t is available")
191162
if(NOT SIZEOF_PTRDIFF_T)
192-
set(SIZEOF_PTRDIFF_T 8 CACHE INTERNAL "Size of ptrdiff_t")
193-
message(WARNING "Couldn't determine size of ptrdiff_t, setting to 8.")
163+
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
164+
set(SIZEOF_PTRDIFF_T 4 CACHE INTERNAL "Size of ptrdiff_t")
165+
else
166+
set(SIZEOF_PTRDIFF_T 8 CACHE INTERNAL "Size of ptrdiff_t")
167+
endif()
168+
169+
message(
170+
WARNING
171+
"Couldn't determine the ptrdiff_t size, setting it to ${SIZEOF_PTRDIFF_T}."
172+
)
173+
endif()
174+
175+
check_type_size("size_t" SIZEOF_SIZE_T)
176+
check_type_size("ssize_t" SIZEOF_SSIZE_T)
177+
178+
check_type_size("uid_t" SIZEOF_UID_T)
179+
if(NOT HAVE_SIZEOF_UID_T)
180+
set(
181+
uid_t int
182+
CACHE INTERNAL "Define as 'int' if <sys/types.h> doesn't define."
183+
)
194184
endif()
195185

196186
# Check for socklen_t type.

cmake/main/config.w32.cmake.h.in

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
# define _USE_32BIT_TIME_T 1
1818
#endif
1919

20+
/* On Windows the ssize_t is not available, but there is SSIZE_T defined in
21+
<BaseTsd.h>. */
22+
#define ssize_t SSIZE_T
23+
24+
#define STDIN_FILENO 0
25+
#define STDOUT_FILENO 1
26+
#define STDERR_FILENO 2
27+
2028
/* The cdb handler header file. */
2129
#cmakedefine CDB_INCLUDE_FILE "@CDB_INCLUDE_FILE@"
2230

@@ -1920,32 +1928,36 @@
19201928
/* The QDBM handler header file. */
19211929
#cmakedefine QDBM_INCLUDE_FILE "@QDBM_INCLUDE_FILE@"
19221930

1923-
/* int and long are still 32bit in 64bit compiles */
1924-
#define SIZEOF_INT 4
1925-
#define SIZEOF_LONG 4
1926-
/* MSVC.6/NET don't allow 'long long' or know 'intmax_t' */
1927-
#define SIZEOF_LONG_LONG 8 /* defined as __int64 */
1928-
#define SIZEOF_INTMAX_T 0
1929-
#define ssize_t SSIZE_T
1930-
#ifdef _WIN64
1931-
# define SIZEOF_SIZE_T 8
1932-
# define SIZEOF_PTRDIFF_T 8
1933-
#else
1934-
# define SIZEOF_SIZE_T 4
1935-
# define SIZEOF_PTRDIFF_T 4
1936-
#endif
1937-
#define SIZEOF_OFF_T 4
1931+
/* The size of 'int', as computed by sizeof. */
1932+
#cmakedefine SIZEOF_INT @SIZEOF_INT@
1933+
1934+
/* The size of 'intmax_t', as computed by sizeof. */
1935+
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@
1936+
1937+
/* The size of 'long', as computed by sizeof. */
1938+
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
1939+
1940+
/* The size of 'long long', as computed by sizeof. */
1941+
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
1942+
1943+
/* The size of 'off_t', as computed by sizeof. */
1944+
#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@
1945+
1946+
/* The size of 'ptrdiff_t', as computed by sizeof. */
1947+
#cmakedefine SIZEOF_PTRDIFF_T @SIZEOF_PTRDIFF_T@
1948+
1949+
/* The size of 'size_t', as computed by sizeof. */
1950+
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
1951+
1952+
/* The size of 'ssize_t', as computed by sizeof. */
1953+
#cmakedefine SIZEOF_SSIZE_T @SIZEOF_SSIZE_T@
19381954

19391955
/* Define to 1 if SQLite library was compiled with the
19401956
SQLITE_OMIT_LOAD_EXTENSION and does not have the extension support with the
19411957
'sqlite3_load_extension' function. For usage in the sqlite3 PHP extension.
19421958
See https://www.sqlite.org/compile.html. */
19431959
#cmakedefine SQLITE_OMIT_LOAD_EXTENSION 1
19441960

1945-
#define STDIN_FILENO 0
1946-
#define STDOUT_FILENO 1
1947-
#define STDERR_FILENO 2
1948-
19491961
/* Define to 1 to be able to use the wchar defs in the obsolete <sqlunix.h>
19501962
header file on some FreeBSD systems. */
19511963
#cmakedefine SS_FBX 1

0 commit comments

Comments
 (0)