Skip to content

Commit 5c7e6a9

Browse files
committed
Merge branch 'PHP-8.4'
2 parents d14c23b + 0521afe commit 5c7e6a9

File tree

4 files changed

+48
-27
lines changed

4 files changed

+48
-27
lines changed

cmake/cmake/ConfigureChecks.cmake

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,38 +142,62 @@ if(NOT HAVE_SIZEOF_GID_T)
142142
endif()
143143

144144
check_type_size("int" SIZEOF_INT)
145+
if(SIZEOF_INT STREQUAL "")
146+
set(SIZEOF_INT_CODE "#define SIZEOF_INT 0")
147+
endif()
145148

149+
# TODO: PHP on Windows sets the SIZEOF_INTMAX_T to 0 to skip certain checks,
150+
# otherwise the intmax_t type and its size are available. Windows-related C code
151+
# should probably be rechecked and fixed at some point.
146152
check_type_size("intmax_t" SIZEOF_INTMAX_T)
147-
if(NOT SIZEOF_INTMAX_T)
148-
set(SIZEOF_INTMAX_T 0 CACHE INTERNAL "Size of intmax_t")
149-
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")
153+
if(SIZEOF_INTMAX_T STREQUAL "" OR CMAKE_SYSTEM_NAME STREQUAL "Windows")
154+
set(SIZEOF_INTMAX_T_CODE "#define SIZEOF_INTMAX_T 0")
154155
endif()
155156

156157
check_type_size("long" SIZEOF_LONG)
158+
if(SIZEOF_LONG STREQUAL "")
159+
set(SIZEOF_LONG_CODE "#define SIZEOF_LONG 0")
160+
endif()
161+
157162
check_type_size("long long" SIZEOF_LONG_LONG)
163+
if(SIZEOF_LONG_LONG STREQUAL "")
164+
set(SIZEOF_LONG_LONG_CODE "#define SIZEOF_LONG_LONG 0")
165+
endif()
166+
158167
check_type_size("off_t" SIZEOF_OFF_T)
168+
if(SIZEOF_OFF_T STREQUAL "")
169+
set(SIZEOF_OFF_T_CODE "#define SIZEOF_OFF_T 0")
170+
endif()
159171

172+
# TODO: The ptrdiff_t is always available by C89 standard and its size varies
173+
# between 32-bit and 64-bit target platforms. Checking whether the ptrdiff_t
174+
# exists is redundant and is left here as PHP still checks it conditionally in
175+
# the intl extension.
160176
check_type_size("ptrdiff_t" SIZEOF_PTRDIFF_T)
161-
set(HAVE_PTRDIFF_T 1 CACHE INTERNAL "Whether ptrdiff_t is available")
162-
if(NOT SIZEOF_PTRDIFF_T)
177+
if(SIZEOF_PTRDIFF_T STREQUAL "")
163178
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
164-
set(SIZEOF_PTRDIFF_T 4 CACHE INTERNAL "Size of ptrdiff_t")
179+
set(SIZEOF_PTRDIFF_T 4)
165180
else()
166-
set(SIZEOF_PTRDIFF_T 8 CACHE INTERNAL "Size of ptrdiff_t")
181+
set(SIZEOF_PTRDIFF_T 8)
167182
endif()
183+
set(SIZEOF_PTRDIFF_T_CODE "#define SIZEOF_PTRDIFF_T ${SIZEOF_PTRDIFF_T}")
168184

169185
message(
170186
WARNING
171187
"Couldn't determine the ptrdiff_t size, setting it to ${SIZEOF_PTRDIFF_T}."
172188
)
173189
endif()
190+
set(HAVE_PTRDIFF_T 1)
174191

175192
check_type_size("size_t" SIZEOF_SIZE_T)
193+
if(SIZEOF_SIZE_T STREQUAL "")
194+
set(SIZEOF_SIZE_T_CODE "#define SIZEOF_SIZE_T 0")
195+
endif()
196+
176197
check_type_size("ssize_t" SIZEOF_SSIZE_T)
198+
if(SIZEOF_SSIZE_T STREQUAL "")
199+
set(SIZEOF_SSIZE_T_CODE "#define SIZEOF_SSIZE_T 0")
200+
endif()
177201

178202
check_type_size("uid_t" SIZEOF_UID_T)
179203
if(NOT HAVE_SIZEOF_UID_T)
@@ -188,10 +212,7 @@ cmake_push_check_state(RESET)
188212
if(HAVE_SYS_SOCKET_H)
189213
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
190214
endif()
191-
check_type_size("socklen_t" SIZEOF_SOCKLEN_T)
192-
if(HAVE_SIZEOF_SOCKLEN_T)
193-
set(HAVE_SOCKLEN_T 1 CACHE INTERNAL "Whether the system has the type 'socklen_t'.")
194-
endif()
215+
check_type_size("socklen_t" SOCKLEN_T)
195216
cmake_pop_check_state()
196217

197218
################################################################################

cmake/ext/pcntl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ cmake_pop_check_state()
130130

131131
cmake_push_check_state(RESET)
132132
set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
133-
check_type_size(siginfo_t HAVE_STRUCT_SIGINFO_T)
133+
check_type_size(siginfo_t STRUCT_SIGINFO_T)
134134
cmake_pop_check_state()
135135

136136
if(HAVE_STRUCT_SIGINFO_T)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
/* Define to 1 if the system has the type 'union semun'. */
2+
#cmakedefine HAVE_UNION_SEMUN 1
3+
14
/* Define to 1 if the PHP extension 'sysvsem' is available. */
25
#cmakedefine HAVE_SYSVSEM 1

cmake/main/php_config.cmake.h.in

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,6 @@
573573
/* Define to 1 if you have the 'tzset' function. */
574574
#cmakedefine HAVE_TZSET 1
575575

576-
/* Define to 1 if the system has the type 'union semun'. */
577-
#cmakedefine HAVE_UNION_SEMUN 1
578-
579576
/* Define to 1 if you have the <unistd.h> header file. */
580577
#cmakedefine HAVE_UNISTD_H 1
581578

@@ -746,28 +743,28 @@
746743
#cmakedefine PROC_MEM_FILE "@PROC_MEM_FILE@"
747744

748745
/* The size of 'int', as computed by sizeof. */
749-
#cmakedefine SIZEOF_INT @SIZEOF_INT@
746+
@SIZEOF_INT_CODE@
750747

751748
/* The size of 'intmax_t', as computed by sizeof. */
752-
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@
749+
@SIZEOF_INTMAX_T_CODE@
753750

754751
/* The size of 'long', as computed by sizeof. */
755-
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
752+
@SIZEOF_LONG_CODE@
756753

757754
/* The size of 'long long', as computed by sizeof. */
758-
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
755+
@SIZEOF_LONG_LONG_CODE@
759756

760757
/* The size of 'off_t', as computed by sizeof. */
761-
#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@
758+
@SIZEOF_OFF_T_CODE@
762759

763760
/* The size of 'ptrdiff_t', as computed by sizeof. */
764-
#cmakedefine SIZEOF_PTRDIFF_T @SIZEOF_PTRDIFF_T@
761+
@SIZEOF_PTRDIFF_T_CODE@
765762

766763
/* The size of 'size_t', as computed by sizeof. */
767-
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
764+
@SIZEOF_SIZE_T_CODE@
768765

769766
/* The size of 'ssize_t', as computed by sizeof. */
770-
#cmakedefine SIZEOF_SSIZE_T @SIZEOF_SSIZE_T@
767+
@SIZEOF_SSIZE_T_CODE@
771768

772769
/* Define to 1 if strerror_r returns char *. */
773770
#cmakedefine STRERROR_R_CHAR_P 1

0 commit comments

Comments
 (0)