diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c index 823fb4088d8..0f6c216502d 100644 --- a/ext/intl/collator/collator_is_numeric.c +++ b/ext/intl/collator/collator_is_numeric.c @@ -14,6 +14,9 @@ */ #include "collator_is_numeric.h" +#include "zend_strtod.h" + +#include /* {{{ Taken from PHP6:zend_u_strtod() */ static double collator_u_strtod(const UChar *nptr, UChar **endptr) /* {{{ */ diff --git a/ext/json/json_encoder.c b/ext/json/json_encoder.c index adb53598326..a3e136ec9b5 100644 --- a/ext/json/json_encoder.c +++ b/ext/json/json_encoder.c @@ -28,6 +28,7 @@ #include "php_json_encoder.h" #include #include "zend_enum.h" +#include "zend_strtod.h" // for ZEND_DOUBLE_MAX_LENGTH static const char digits[] = "0123456789abcdef"; diff --git a/ext/json/json_scanner.re b/ext/json/json_scanner.re index 1db43dd081a..014f29bd564 100644 --- a/ext/json/json_scanner.re +++ b/ext/json/json_scanner.re @@ -18,6 +18,7 @@ #include "php_json_scanner.h" #include "php_json_scanner_defs.h" #include "php_json_parser.h" +#include "zend_strtod.h" #include "json_parser.tab.h" #define YYCTYPE php_json_ctype diff --git a/ext/mbstring/libmbfl/filters/mbfilter_base64.c b/ext/mbstring/libmbfl/filters/mbfilter_base64.c index ede3eef18ce..bc06c6a1abf 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_base64.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_base64.c @@ -30,6 +30,7 @@ #include "mbfilter.h" #include "mbfilter_base64.h" +#include "zend_multiply.h" // for zend_safe_address_guarded() static size_t mb_base64_to_wchar(unsigned char **in, size_t *in_len, uint32_t *buf, size_t bufsize, unsigned int *state); static void mb_wchar_to_base64(uint32_t *in, size_t len, mb_convert_buf *buf, bool end); diff --git a/ext/mysqlnd/mysql_float_to_double.h b/ext/mysqlnd/mysql_float_to_double.h index a15458b52de..b868aa67aa4 100644 --- a/ext/mysqlnd/mysql_float_to_double.h +++ b/ext/mysqlnd/mysql_float_to_double.h @@ -20,6 +20,7 @@ #include "main/php.h" #include #include "main/snprintf.h" +#include "zend_strtod.h" #define MAX_CHAR_BUF_LEN 255 diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c index ed4d1af277d..666ab666215 100644 --- a/ext/mysqlnd/mysqlnd_connection.c +++ b/ext/mysqlnd/mysqlnd_connection.c @@ -30,6 +30,8 @@ #include "mysqlnd_ext_plugin.h" #include "zend_smart_str.h" +#include +#include // for strerror() extern MYSQLND_CHARSET *mysqlnd_charsets; diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index fce042ec5be..25f178e0b57 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -23,6 +23,7 @@ #include "mysqlnd_wireprotocol.h" #include "mysqlnd_statistics.h" #include "mysqlnd_debug.h" +#include "zend_strtod.h" #define BAIL_IF_NO_MORE_DATA \ if (UNEXPECTED((size_t)(p - begin) > packet->header.size)) { \ diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index dcad3356475..b3529354b8a 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -35,6 +35,7 @@ #include "php_oci8.h" #include "php_oci8_int.h" +#include "zend_strtod.h" /* {{{ php_oci_collection_create() Create and return connection handle */ diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 429d8dbd49f..b7af6f83d31 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -51,6 +51,10 @@ #include #endif +#ifdef HAVE_MPROTECT +#include +#endif + #ifdef ZTS int jit_globals_id; #else diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index 1cd639403f6..f98bd66fa04 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -42,6 +42,7 @@ #include #include +#include #include #if HAVE_UNISTD_H diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 04807680892..d245fab5a78 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -36,6 +36,8 @@ #include #include +#include + #ifdef PHP_WIN32 #include "win32/winutil.h" #include "win32/time.h" diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index f4fd60e96eb..099e1e5bbbc 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -20,6 +20,7 @@ #include "php_pcre.h" #include "ext/standard/info.h" #include "ext/standard/basic_functions.h" +#include "zend_multiply.h" // for zend_safe_address_guarded() #include "zend_smart_str.h" #include "SAPI.h" diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index ec4d5ec6586..cdd9b6ddae3 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -34,6 +34,8 @@ #include "zend_exceptions.h" #include "pgsql_driver_arginfo.h" +#include + static bool pgsql_handle_in_transaction(pdo_dbh_t *dbh); static char * _pdo_pgsql_trim_message(const char *message, int persistent) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 00bdf15286e..0679b2b6c46 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -39,6 +39,7 @@ #include "php_pgsql.h" #include "php_globals.h" #include "zend_exceptions.h" +#include "zend_strtod.h" #ifdef HAVE_PGSQL diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 41c55b75898..27e9ad204b9 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -21,6 +21,8 @@ #include "func_interceptors.h" #include "phar_object_arginfo.h" +#include + static zend_class_entry *phar_ce_archive; static zend_class_entry *phar_ce_data; static zend_class_entry *phar_ce_PharException; diff --git a/ext/random/gammasection.c b/ext/random/gammasection.c index aa4531fba22..b8d32c3c2fe 100644 --- a/ext/random/gammasection.c +++ b/ext/random/gammasection.c @@ -24,6 +24,8 @@ #include "php_random.h" #include +#include // for DBL_MAX + /* This file implements the γ-section algorithm as published in: * * Drawing Random Floating-Point Numbers from an Interval. Frédéric diff --git a/ext/random/random.c b/ext/random/random.c index 4177bfc885f..a66f18c7a5c 100644 --- a/ext/random/random.c +++ b/ext/random/random.c @@ -41,6 +41,7 @@ # include #else # include +# include #endif #ifdef __linux__ diff --git a/ext/random/randomizer.c b/ext/random/randomizer.c index 75e88c8b010..23860ada8a2 100644 --- a/ext/random/randomizer.c +++ b/ext/random/randomizer.c @@ -27,6 +27,8 @@ #include "Zend/zend_enum.h" #include "Zend/zend_exceptions.h" +#include // for DBL_MANT_DIG + static inline void randomizer_common_init(php_random_randomizer *randomizer, zend_object *engine_object) { if (engine_object->ce->type == ZEND_INTERNAL_CLASS) { /* Internal classes always php_random_engine struct */ diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index be4f57ad271..dfb301788dd 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -33,11 +33,13 @@ #include "tsrm_win32.h" #endif - #ifdef HAVE_SHMOP #include "ext/standard/info.h" +#include +#include // for strerror() + /* {{{ shmop_module_entry */ zend_module_entry shmop_module_entry = { STANDARD_MODULE_HEADER, diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 3b7d6c3885d..6fc81d30686 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -25,6 +25,8 @@ #include "zend_strtod.h" #include "zend_interfaces.h" +#include + /* zval type decode */ static zval *to_zval_double(zval* ret, encodeTypePtr type, xmlNodePtr data); static zval *to_zval_long(zval* ret, encodeTypePtr type, xmlNodePtr data); diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index ae90cbe59d2..bb314b4bb4d 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -24,6 +24,7 @@ # include #endif +#include #include #include #include diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index ef32661be09..00e7b8f0488 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -39,6 +39,7 @@ #include "sockaddr_conv.h" #include "main/php_network.h" +#include enum source_op { JOIN_SOURCE, diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c index 5623b556aa0..eac78bda413 100644 --- a/ext/sockets/sendrecvmsg.c +++ b/ext/sockets/sendrecvmsg.c @@ -28,6 +28,8 @@ #include #endif +#include + #define MAX_USER_BUFF_SIZE ((size_t)(100*1024*1024)) #define DEFAULT_BUFF_SIZE 8192 #define MAX_ARRAY_KEY_SIZE 128 diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c index 6ec540931f7..2e8686bf5ab 100644 --- a/ext/sockets/sockaddr_conv.c +++ b/ext/sockets/sockaddr_conv.c @@ -5,6 +5,7 @@ #ifdef PHP_WIN32 #include "windows_common.h" #else +#include #include #include #endif diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 5c32e2f9ee3..fc806b457a1 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -36,6 +36,9 @@ #include "spl_directory_arginfo.h" #include "spl_exceptions.h" +#include +#include // for strerror() + #define SPL_HAS_FLAG(flags, test_flag) ((flags & test_flag) ? 1 : 0) /* declare the class handlers */ diff --git a/ext/standard/array.c b/ext/standard/array.c index 6252b61d204..96a32da8e05 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -40,6 +40,7 @@ #include "zend_smart_str.h" #include "zend_bitset.h" #include "zend_exceptions.h" +#include "zend_strtod.h" #include "ext/spl/spl_array.h" #include "ext/random/php_random.h" diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index f65a71a7266..4e10cac38c7 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -117,6 +117,10 @@ PHPAPI php_basic_globals basic_globals; #include "streamsfuncs.h" #include "basic_functions_arginfo.h" +#if defined(HAVE_NANOSLEEP) || !defined(PHP_WIN32) +#include +#endif + typedef struct _user_tick_function_entry { zend_fcall_info fci; zend_fcall_info_cache fci_cache; diff --git a/ext/standard/dns.c b/ext/standard/dns.c index d229b998a4b..a5a5d86483e 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -57,6 +57,9 @@ extern void __res_ndestroy(res_state statp); #endif #endif +#include +#include // for strerror() + #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 255 #endif diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 1b1b0ab9e9c..108c7d282f8 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -46,6 +46,10 @@ #include #endif +#ifdef HAVE_NICE +#include +#endif + #include #ifdef PHP_WIN32 diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index b988422df21..a98d410a228 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -19,6 +19,7 @@ #include "ext/standard/head.h" #include "php_string.h" #include "zend_execute.h" +#include "zend_strtod.h" // for zend_gcvt() #include #include diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c index 1a046b3de69..d00dd6d75e5 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -27,6 +27,10 @@ #endif #ifdef HAVE_FTOK + +#include +#include // for strerror() + /* {{{ Convert a pathname and a project identifier to a System V IPC key */ PHP_FUNCTION(ftok) { diff --git a/ext/standard/hrtime.c b/ext/standard/hrtime.c index 7dca135c920..5fe4f950f31 100644 --- a/ext/standard/hrtime.c +++ b/ext/standard/hrtime.c @@ -17,6 +17,7 @@ #include "php.h" #include "hrtime.h" +#include "zend_strtod.h" /* {{{ */ /* This file reuses code parts from the cross-platform timer library diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 55790e6100f..b5e7efe8e45 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -44,6 +44,8 @@ #ifdef PHP_WIN32 # include "win32/sendmail.h" +#else +# include #endif #define SKIP_LONG_HEADER_SEP(str, pos) \ diff --git a/ext/standard/math.c b/ext/standard/math.c index ad2823ea49b..5b2d74a2de9 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -23,6 +23,7 @@ #include "zend_exceptions.h" #include "zend_portability.h" #include "zend_bitset.h" +#include "zend_strtod.h" #include #include diff --git a/ext/standard/net.c b/ext/standard/net.c index b22f304c8eb..83d3e217042 100644 --- a/ext/standard/net.c +++ b/ext/standard/net.c @@ -47,6 +47,9 @@ # include #endif +#include +#include // for strerror() + PHPAPI zend_string* php_inet_ntop(const struct sockaddr *addr) { socklen_t addrlen = sizeof(struct sockaddr_in); diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 8926485025a..8f70ba2094c 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -29,6 +29,9 @@ #include "php_fopen_wrappers.h" #include "SAPI.h" +#include +#include // for strerror() + static ssize_t php_stream_output_write(php_stream *stream, const char *buf, size_t count) /* {{{ */ { PHPWRITE(buf, count); diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 53ec6faa101..4281be769da 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -36,6 +36,9 @@ #include #endif +#include +#include // for strerror() + /* This symbol is defined in ext/standard/config.m4. * Essentially, it is set if you HAVE_FORK || PHP_WIN32 * Other platforms may modify that configure check and add suitable #ifdefs diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index ac2c777eea5..5af3ec3d638 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -40,6 +40,9 @@ typedef unsigned long long php_timeout_ull; typedef unsigned __int64 php_timeout_ull; #endif +#include +#include // for strerror() + #define GET_CTX_OPT(stream, wrapper, name, val) (PHP_STREAM_CONTEXT(stream) && NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), wrapper, name))) static php_stream_context *decode_context_param(zval *contextresource); diff --git a/ext/standard/var.c b/ext/standard/var.c index 7c6f79aba75..70747450998 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -28,6 +28,7 @@ #include "php_incomplete_class.h" #include "zend_enum.h" #include "zend_exceptions.h" +#include "zend_strtod.h" // for zend_gcvt() /* }}} */ struct php_serialize_data { diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 12b0ff47c80..fee8f9a73bf 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -19,6 +19,7 @@ #include "php_incomplete_class.h" #include "zend_portability.h" #include "zend_exceptions.h" +#include "zend_strtod.h" /* {{{ reference-handling for unserializer: var_* */ #define VAR_ENTRIES_MAX 1018 /* 1024 - offsetof(php_unserialize_data, entries) / sizeof(void*) */ diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index debb8b675b0..caaa5eccef3 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -22,10 +22,13 @@ #include "php_globals.h" #include "ext/standard/info.h" #include "php_sysvmsg.h" -#include "sysvmsg_arginfo.h" #include "ext/standard/php_var.h" #include "zend_smart_str.h" +#include +#include "sysvmsg_arginfo.h" + +#include // for strerror() #include #include #include