Skip to content

Commit d03329e

Browse files
committed
Remove fclose() check and fix nits
Checking whether fclose declaration fails is obsolete on current systems, neither code base has any issues elsewhere in PHP-8.3. CS style synced further.
1 parent 63e550f commit d03329e

File tree

5 files changed

+19
-78
lines changed

5 files changed

+19
-78
lines changed

cmake/ext/standard/CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,8 @@ endif()
284284
# Configuration checks.
285285
################################################################################
286286

287-
# Check for ARM CRC32 API.
288287
include(cmake/CheckArmCrc32.cmake)
289-
290-
# Check for missing fclose declaration.
291-
include(cmake/CheckFclose.cmake)
292-
293-
# Check for fnmatch() implementation.
294288
include(cmake/CheckFnmatch.cmake)
295-
296-
# Check strptime().
297289
include(cmake/CheckStrptime.cmake)
298290

299291
# Check if there is a support means of creating a new process and defining which
@@ -311,7 +303,7 @@ else()
311303
message(CHECK_FAIL "no")
312304
endif()
313305

314-
# The getifaddrs() is available in C library some systems (Solaris 11.4...)
306+
# The getifaddrs() is available in C library on some systems (Solaris 11.4...)
315307
php_search_libraries(
316308
getifaddrs
317309
HEADERS ifaddrs.h

cmake/ext/standard/cmake/CheckCrypt.cmake

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
#[=============================================================================[
2-
# CheckCrypt
3-
4-
Check whether the `crypt` library works as expected for PHP by running a set of
2+
Check whether the 'crypt' library works as expected for PHP by running a set of
53
PHP-specific checks.
64
7-
## Cache variables
8-
9-
* `HAVE_CRYPT_H`
10-
* `HAVE_CRYPT`
11-
* `HAVE_CRYPT_R`
12-
* `CRYPT_R_CRYPTD`
13-
* `CRYPT_R_STRUCT_CRYPT_DATA`
14-
* `CRYPT_R_GNU_SOURCE`
15-
16-
## Usage
5+
Cache variables:
176
18-
```cmake
19-
# CMakeLists.txt
20-
include(cmake/CheckCrypt.cmake)
21-
```
7+
* HAVE_CRYPT_H
8+
* HAVE_CRYPT
9+
* HAVE_CRYPT_R
10+
* CRYPT_R_CRYPTD
11+
* CRYPT_R_STRUCT_CRYPT_DATA
12+
* CRYPT_R_GNU_SOURCE
2213
#]=============================================================================]
2314

2415
include_guard(GLOBAL)
@@ -30,7 +21,7 @@ include(CheckSymbolExists)
3021
include(CMakePushCheckState)
3122

3223
# Check whether crypt() and crypt_r() are available.
33-
function(_php_check_crypt)
24+
function(_php_ext_standard_check_crypt)
3425
message(CHECK_START "Checking basic crypt functionality")
3526

3627
cmake_push_check_state(RESET)
@@ -67,7 +58,7 @@ function(_php_check_crypt)
6758
endfunction()
6859

6960
# Detect the style of crypt_r() if any is available.
70-
function(_php_check_crypt_r result)
61+
function(_php_ext_standard_check_crypt_r result)
7162
set(${result} TRUE PARENT_SCOPE)
7263

7364
message(CHECK_START "Checking crypt_r() data struct")
@@ -178,7 +169,7 @@ function(_php_check_crypt_r result)
178169
endfunction()
179170

180171
# Check if crypt library is usable.
181-
function(_php_check_crypt_is_usable)
172+
function(_php_ext_standard_check_crypt_is_usable)
182173
cmake_push_check_state(RESET)
183174
set(CMAKE_REQUIRED_QUIET TRUE)
184175

@@ -406,9 +397,9 @@ function(_php_check_crypt_is_usable)
406397
endfunction()
407398

408399
block()
409-
_php_check_crypt()
400+
_php_ext_standard_check_crypt()
410401

411-
_php_check_crypt_r(result)
402+
_php_ext_standard_check_crypt_r(result)
412403
if(NOT result)
413404
message(
414405
FATAL_ERROR
@@ -417,5 +408,5 @@ block()
417408
)
418409
endif()
419410

420-
_php_check_crypt_is_usable()
411+
_php_ext_standard_check_crypt_is_usable()
421412
endblock()

cmake/ext/standard/cmake/CheckFclose.cmake

Lines changed: 0 additions & 43 deletions
This file was deleted.

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@
6666
#cmakedefine HAVE_STRPTIME_DECL_FAILS 1
6767

6868
/* Define to 1 if 'fclose' declaration is missing, and to 0 if declaration is
69-
available. */
70-
#cmakedefine01 MISSING_FCLOSE_DECL
69+
available. Some systems (e.g., SunOS) once had broken headers. This issue is
70+
obsolete on current Solaris/illumos versions. */
71+
#define MISSING_FCLOSE_DECL 0
7172

7273
/* Define to 1 if your system has fork/vfork/CreateProcess. */
7374
#cmakedefine PHP_CAN_SUPPORT_PROC_OPEN 1

cmake/main/cmake/php_config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@
575575
#cmakedefine PHP_HAVE_BUILTIN_CPU_SUPPORTS 1
576576

577577
/* Define to 1 if the compiler supports '__builtin_ctzl'. */
578-
#cmakedefine PHP_HAVE_BUILTIN_CTZL
578+
#cmakedefine PHP_HAVE_BUILTIN_CTZL 1
579579

580580
/* Define to 1 if the compiler supports '__builtin_ctzll'. */
581581
#cmakedefine PHP_HAVE_BUILTIN_CTZLL 1

0 commit comments

Comments
 (0)