mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Replace php_stdint.h header with standard headers (#8613)
This commit is contained in:
parent
492021168d
commit
d08451b2ca
13 changed files with 19 additions and 69 deletions
|
@ -20,7 +20,7 @@
|
|||
# include "main/php_config.h"
|
||||
#endif
|
||||
|
||||
#include "main/php_stdint.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| https://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Michael Wallner <mike@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef PHP_STDINT_H
|
||||
#define PHP_STDINT_H
|
||||
|
||||
/* C99 requires these for C++ to get the definitions
|
||||
* of INT64_MAX and other macros used by Zend/zend_long.h
|
||||
* C11 drops this requirement, so these effectively
|
||||
* just backport that piece of behavior.
|
||||
*
|
||||
* These defines are placed here instead of
|
||||
* with the include below, because sys/types
|
||||
* and inttypes may include stdint themselves.
|
||||
* And these definitions MUST come first.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
# ifndef __STDC_LIMIT_MACROS
|
||||
# define __STDC_LIMIT_MACROS
|
||||
# endif
|
||||
# ifndef __STDC_CONSTANT_MACROS
|
||||
# define __STDC_CONSTANT_MACROS
|
||||
# endif
|
||||
# ifndef __STDC_FORMAT_MACROS
|
||||
# define __STDC_FORMAT_MACROS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# ifndef u_char
|
||||
typedef unsigned __int8 u_char;
|
||||
# endif
|
||||
#endif /* !_MSC_VER */
|
||||
|
||||
#endif /* PHP_STDINT_H */
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue