Skip to content

Commit d08451b

Browse files
authored
Replace php_stdint.h header with standard headers (#8613)
1 parent 4920211 commit d08451b

File tree

13 files changed

+19
-69
lines changed

13 files changed

+19
-69
lines changed

TSRM/TSRM.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# include "main/php_config.h"
2121
#endif
2222

23-
#include "main/php_stdint.h"
23+
#include <stdint.h>
2424
#include <stdbool.h>
2525

2626
#ifdef TSRM_WIN32

UPGRADING.INTERNALS

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ PHP 8.2 INTERNALS UPGRADE NOTES
2121
Call zend_str_tolower() yourself if necessary. You no longer need to copy
2222
the haystack and needle before passing them to php_stristr().
2323
* zend_register_module_ex() no longer copies the module entry.
24+
* The main/php_stdint.h header has been removed.
25+
Include the standard <inttypes.h> and/or <stdint.h> headers instead.
26+
Replace usage of u_char by the standard C99 uint8_t type.
2427

2528
========================
2629
2. Build system changes

Zend/zend_long.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#ifndef ZEND_LONG_H
2020
#define ZEND_LONG_H
2121

22-
#include "main/php_stdint.h"
22+
#include <inttypes.h>
23+
#include <stdint.h>
2324

2425
/* This is the heart of the whole int64 enablement in zval. */
2526
#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)

ext/date/config.w32

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ ADD_FLAG('CFLAGS_DATE', "/wd4244");
88

99
var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true);
1010
tl_config.WriteLine("#include \"config.w32.h\"");
11-
tl_config.WriteLine("#include <php_stdint.h>");
11+
tl_config.WriteLine("#include <inttypes.h>");
12+
tl_config.WriteLine("#include <stdint.h>");
1213
tl_config.WriteLine("#include \"zend.h\"");
1314
tl_config.WriteLine("#define timelib_malloc emalloc");
1415
tl_config.WriteLine("#define timelib_realloc erealloc");

ext/date/config0.m4

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ cat > $ext_builddir/lib/timelib_config.h <<EOF
2323
#else
2424
# include <php_config.h>
2525
#endif
26-
#include <php_stdint.h>
26+
#include <inttypes.h>
27+
#include <stdint.h>
2728

2829
#include "zend.h"
2930

ext/fileinfo/libmagic.patch

+2-1
Original file line numberDiff line numberDiff line change
@@ -3503,7 +3503,8 @@ diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
35033503

35043504
#include "file.h"
35053505

3506-
+#include "php_stdint.h"
3506+
+#include <inttypes.h>
3507+
+#include <stdint.h>
35073508
+
35083509
#include <assert.h>
35093510
#include <ctype.h>

ext/fileinfo/libmagic/strcasestr.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ __RCSID("$NetBSD: strncasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
3939

4040
#include "file.h"
4141

42-
#include "php_stdint.h"
43-
42+
#include <inttypes.h>
43+
#include <stdint.h>
4444
#include <assert.h>
4545
#include <ctype.h>
4646
#include <string.h>

ext/mysqlnd/mysqlnd_portability.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This file is public domain and comes with NO WARRANTY of any kind */
3838
#define atoll atol
3939
#endif
4040

41-
#include "php_stdint.h"
41+
#include <stdint.h>
4242

4343
#if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG)
4444
#define _LONG_LONG 1 /* For AIX string library */

ext/session/mod_mm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include <sys/stat.h>
2525
#include <sys/types.h>
2626
#include <fcntl.h>
27+
#include <stdint.h>
2728

28-
#include "php_stdint.h"
2929
#include "php_session.h"
3030
#include "mod_mm.h"
3131
#include "SAPI.h"

main/php.h

-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ typedef unsigned int socklen_t;
211211

212212
#include <stdarg.h>
213213

214-
#include "php_stdint.h"
215-
216214
#include "zend_hash.h"
217215
#include "zend_alloc.h"
218216
#include "zend_stack.h"

main/php_stdint.h

-51
This file was deleted.

sapi/cli/php_http_parser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern "C" {
3434
# include "php_config.h"
3535
#endif
3636

37-
#include "php_stdint.h"
37+
#include <stdint.h>
3838

3939
/* Compile with -DPHP_HTTP_PARSER_STRICT=0 to make less checks, but run
4040
* faster

sapi/phpdbg/phpdbg.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@
2727
# define PHPDBG_API
2828
#endif
2929

30-
#ifndef PHP_WIN32
31-
# include <stdint.h>
32-
# include <stddef.h>
33-
#else
34-
# include "main/php_stdint.h"
35-
#endif
30+
#include <stdint.h>
31+
#include <stddef.h>
3632
#include "php.h"
3733
#include "php_globals.h"
3834
#include "php_variables.h"

0 commit comments

Comments
 (0)