Skip to content

Commit 607ebc8

Browse files
committed
Refactor strptime checks and ext/standard config header
1 parent 3e2711f commit 607ebc8

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

cmake/cmake/ConfigureChecks.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,6 @@ check_symbol_exists(strlcat "string.h" HAVE_STRLCAT)
404404
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
405405
check_symbol_exists(explicit_bzero "string.h" HAVE_EXPLICIT_BZERO)
406406

407-
# Check strptime().
408-
include(PHP/CheckStrptime)
409-
410407
# Check reentrant functions.
411408
include(PHP/CheckReentrantFunctions)
412409

cmake/cmake/modules/PHP/CheckStrptime.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ include(CheckSourceCompiles)
2121
include(CheckSymbolExists)
2222
include(CMakePushCheckState)
2323

24+
if(PHP_VERSION VERSION_GREATER_EQUAL 9.0)
25+
message(
26+
DEPRECATION
27+
"PHP/CheckStrptime module is obsolete and should be removed. PHP "
28+
"'strptime()' function is deprecated as of PHP 8.1.0."
29+
)
30+
endif()
31+
2432
cmake_push_check_state(RESET)
2533
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
2634
check_symbol_exists(strptime "time.h" HAVE_STRPTIME)

cmake/ext/standard/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ endif()
275275
# Configuration checks.
276276
################################################################################
277277

278+
# Check strptime().
279+
include(PHP/CheckStrptime)
280+
278281
# Check if there is a support means of creating a new process and defining which
279282
# handles it receives.
280283
message(CHECK_START "Checking if OS can spawn processes with inherited handles")

cmake/ext/standard/config.cmake.h.in

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,15 @@
5959
/* Define to 1 if you have the 'res_search' function. */
6060
#cmakedefine HAVE_RES_SEARCH 1
6161

62-
/* Define to 1 if PHP uses its own crypt_r, and to 0 if using the external
63-
crypt library. */
64-
#cmakedefine01 PHP_USE_PHP_CRYPT_R
62+
/* Define to 1 if you have the 'strptime' function. */
63+
#cmakedefine HAVE_STRPTIME 1
64+
65+
/* Define to 1 if you have the declaration of 'strptime'. */
66+
#cmakedefine HAVE_STRPTIME_DECL_FAILS 1
6567

6668
/* Define to 1 if your system has fork/vfork/CreateProcess. */
6769
#cmakedefine PHP_CAN_SUPPORT_PROC_OPEN 1
70+
71+
/* Define to 1 if PHP uses its own crypt_r, and to 0 if using the external
72+
crypt library. */
73+
#cmakedefine01 PHP_USE_PHP_CRYPT_R

cmake/main/php_config.cmake.h.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,6 @@
478478
/* Define to 1 if you have the 'strnlen' function. */
479479
#cmakedefine HAVE_STRNLEN 1
480480

481-
/* Define to 1 if you have the 'strptime' function. */
482-
#cmakedefine HAVE_STRPTIME 1
483-
484-
/* Define to 1 if you have the declaration of 'strptime'. */
485-
#cmakedefine HAVE_STRPTIME_DECL_FAILS 1
486-
487481
/* Define to 1 if you have the 'strtok_r' function. */
488482
#cmakedefine HAVE_STRTOK_R 1
489483

0 commit comments

Comments
 (0)