Skip to content

Replace php_stdint.h header with standard headers #8613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TSRM/TSRM.h
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
# include "main/php_config.h"
#endif

#include "main/php_stdint.h"
#include <stdint.h>
#include <stdbool.h>

#ifdef TSRM_WIN32
3 changes: 3 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ PHP 8.2 INTERNALS UPGRADE NOTES
Call zend_str_tolower() yourself if necessary. You no longer need to copy
the haystack and needle before passing them to php_stristr().
* zend_register_module_ex() no longer copies the module entry.
* The main/php_stdint.h header has been removed.
Include the standard <inttypes.h> and/or <stdint.h> headers instead.
Replace usage of u_char by the standard C99 uint8_t type.

========================
2. Build system changes
3 changes: 2 additions & 1 deletion Zend/zend_long.h
Original file line number Diff line number Diff line change
@@ -19,7 +19,8 @@
#ifndef ZEND_LONG_H
#define ZEND_LONG_H

#include "main/php_stdint.h"
#include <inttypes.h>
#include <stdint.h>

/* This is the heart of the whole int64 enablement in zval. */
#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)
3 changes: 2 additions & 1 deletion ext/date/config.w32
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@ ADD_FLAG('CFLAGS_DATE', "/wd4244");

var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true);
tl_config.WriteLine("#include \"config.w32.h\"");
tl_config.WriteLine("#include <php_stdint.h>");
tl_config.WriteLine("#include <inttypes.h>");
tl_config.WriteLine("#include <stdint.h>");
tl_config.WriteLine("#include \"zend.h\"");
tl_config.WriteLine("#define timelib_malloc emalloc");
tl_config.WriteLine("#define timelib_realloc erealloc");
3 changes: 2 additions & 1 deletion ext/date/config0.m4
Original file line number Diff line number Diff line change
@@ -23,7 +23,8 @@ cat > $ext_builddir/lib/timelib_config.h <<EOF
#else
# include <php_config.h>
#endif
#include <php_stdint.h>
#include <inttypes.h>
#include <stdint.h>

#include "zend.h"

3 changes: 2 additions & 1 deletion ext/fileinfo/libmagic.patch
Original file line number Diff line number Diff line change
@@ -3503,7 +3503,8 @@ diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c

#include "file.h"

+#include "php_stdint.h"
+#include <inttypes.h>
+#include <stdint.h>
+
#include <assert.h>
#include <ctype.h>
4 changes: 2 additions & 2 deletions ext/fileinfo/libmagic/strcasestr.c
Original file line number Diff line number Diff line change
@@ -39,8 +39,8 @@ __RCSID("$NetBSD: strncasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");

#include "file.h"

#include "php_stdint.h"

#include <inttypes.h>
#include <stdint.h>
#include <assert.h>
#include <ctype.h>
#include <string.h>
2 changes: 1 addition & 1 deletion ext/mysqlnd/mysqlnd_portability.h
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ This file is public domain and comes with NO WARRANTY of any kind */
#define atoll atol
#endif

#include "php_stdint.h"
#include <stdint.h>

#if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG)
#define _LONG_LONG 1 /* For AIX string library */
2 changes: 1 addition & 1 deletion ext/session/mod_mm.c
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdint.h>

#include "php_stdint.h"
#include "php_session.h"
#include "mod_mm.h"
#include "SAPI.h"
2 changes: 0 additions & 2 deletions main/php.h
Original file line number Diff line number Diff line change
@@ -211,8 +211,6 @@ typedef unsigned int socklen_t;

#include <stdarg.h>

#include "php_stdint.h"

#include "zend_hash.h"
#include "zend_alloc.h"
#include "zend_stack.h"
51 changes: 0 additions & 51 deletions main/php_stdint.h

This file was deleted.

2 changes: 1 addition & 1 deletion sapi/cli/php_http_parser.h
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ extern "C" {
# include "php_config.h"
#endif

#include "php_stdint.h"
#include <stdint.h>

/* Compile with -DPHP_HTTP_PARSER_STRICT=0 to make less checks, but run
* faster
8 changes: 2 additions & 6 deletions sapi/phpdbg/phpdbg.h
Original file line number Diff line number Diff line change
@@ -27,12 +27,8 @@
# define PHPDBG_API
#endif

#ifndef PHP_WIN32
# include <stdint.h>
# include <stddef.h>
#else
# include "main/php_stdint.h"
#endif
#include <stdint.h>
#include <stddef.h>
#include "php.h"
#include "php_globals.h"
#include "php_variables.h"