Skip to content

Commit 308fd31

Browse files
MaxKellermannGirgias
authored andcommitted
ext/{standard,json,random,...}: add missing includes
1 parent 16203b5 commit 308fd31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+81
-2
lines changed

Diff for: ext/intl/collator/collator_is_numeric.c

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
*/
1515

1616
#include "collator_is_numeric.h"
17+
#include "zend_strtod.h"
18+
19+
#include <errno.h>
1720

1821
/* {{{ Taken from PHP6:zend_u_strtod() */
1922
static double collator_u_strtod(const UChar *nptr, UChar **endptr) /* {{{ */

Diff for: ext/json/json_encoder.c

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "php_json_encoder.h"
2929
#include <zend_exceptions.h>
3030
#include "zend_enum.h"
31+
#include "zend_strtod.h" // for ZEND_DOUBLE_MAX_LENGTH
3132

3233
static const char digits[] = "0123456789abcdef";
3334

Diff for: ext/json/json_scanner.re

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "php_json_scanner.h"
1919
#include "php_json_scanner_defs.h"
2020
#include "php_json_parser.h"
21+
#include "zend_strtod.h"
2122
#include "json_parser.tab.h"
2223

2324
#define YYCTYPE php_json_ctype

Diff for: ext/mbstring/libmbfl/filters/mbfilter_base64.c

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include "mbfilter.h"
3232
#include "mbfilter_base64.h"
33+
#include "zend_multiply.h" // for zend_safe_address_guarded()
3334

3435
static size_t mb_base64_to_wchar(unsigned char **in, size_t *in_len, uint32_t *buf, size_t bufsize, unsigned int *state);
3536
static void mb_wchar_to_base64(uint32_t *in, size_t len, mb_convert_buf *buf, bool end);

Diff for: ext/mysqlnd/mysql_float_to_double.h

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "main/php.h"
2121
#include <float.h>
2222
#include "main/snprintf.h"
23+
#include "zend_strtod.h"
2324

2425
#define MAX_CHAR_BUF_LEN 255
2526

Diff for: ext/mysqlnd/mysqlnd_connection.c

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include "mysqlnd_ext_plugin.h"
3131
#include "zend_smart_str.h"
3232

33+
#include <errno.h>
34+
#include <string.h> // for strerror()
3335

3436
extern MYSQLND_CHARSET *mysqlnd_charsets;
3537

Diff for: ext/mysqlnd/mysqlnd_wireprotocol.c

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "mysqlnd_wireprotocol.h"
2424
#include "mysqlnd_statistics.h"
2525
#include "mysqlnd_debug.h"
26+
#include "zend_strtod.h"
2627

2728
#define BAIL_IF_NO_MORE_DATA \
2829
if (UNEXPECTED((size_t)(p - begin) > packet->header.size)) { \

Diff for: ext/oci8/oci8_collection.c

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#include "php_oci8.h"
3737
#include "php_oci8_int.h"
38+
#include "zend_strtod.h"
3839

3940
/* {{{ php_oci_collection_create()
4041
Create and return connection handle */

Diff for: ext/opcache/jit/zend_jit.c

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
#include <pthread.h>
5252
#endif
5353

54+
#ifdef HAVE_MPROTECT
55+
#include <errno.h>
56+
#endif
57+
5458
#ifdef ZTS
5559
int jit_globals_id;
5660
#else

Diff for: ext/opcache/zend_file_cache.c

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
#include <sys/types.h>
4444
#include <sys/stat.h>
45+
#include <errno.h>
4546
#include <fcntl.h>
4647

4748
#if HAVE_UNISTD_H

Diff for: ext/openssl/xp_ssl.c

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#include <openssl/bn.h>
3737
#include <openssl/dh.h>
3838

39+
#include <errno.h>
40+
3941
#ifdef PHP_WIN32
4042
#include "win32/winutil.h"
4143
#include "win32/time.h"

Diff for: ext/pcre/php_pcre.c

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "php_pcre.h"
2121
#include "ext/standard/info.h"
2222
#include "ext/standard/basic_functions.h"
23+
#include "zend_multiply.h" // for zend_safe_address_guarded()
2324
#include "zend_smart_str.h"
2425
#include "SAPI.h"
2526

Diff for: ext/pdo_pgsql/pgsql_driver.c

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "zend_exceptions.h"
3535
#include "pgsql_driver_arginfo.h"
3636

37+
#include <errno.h>
38+
3739
static bool pgsql_handle_in_transaction(pdo_dbh_t *dbh);
3840

3941
static char * _pdo_pgsql_trim_message(const char *message, int persistent)

Diff for: ext/pgsql/pgsql.c

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "php_pgsql.h"
4040
#include "php_globals.h"
4141
#include "zend_exceptions.h"
42+
#include "zend_strtod.h"
4243

4344
#ifdef HAVE_PGSQL
4445

Diff for: ext/phar/phar_object.c

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "func_interceptors.h"
2222
#include "phar_object_arginfo.h"
2323

24+
#include <errno.h>
25+
2426
static zend_class_entry *phar_ce_archive;
2527
static zend_class_entry *phar_ce_data;
2628
static zend_class_entry *phar_ce_PharException;

Diff for: ext/random/gammasection.c

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "php_random.h"
2525
#include <math.h>
2626

27+
#include <float.h> // for DBL_MAX
28+
2729
/* This file implements the γ-section algorithm as published in:
2830
*
2931
* Drawing Random Floating-Point Numbers from an Interval. Frédéric

Diff for: ext/random/random.c

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
# include <process.h>
4242
#else
4343
# include <sys/time.h>
44+
# include <errno.h>
4445
#endif
4546

4647
#ifdef __linux__

Diff for: ext/random/randomizer.c

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "Zend/zend_enum.h"
2828
#include "Zend/zend_exceptions.h"
2929

30+
#include <float.h> // for DBL_MANT_DIG
31+
3032
static inline void randomizer_common_init(php_random_randomizer *randomizer, zend_object *engine_object) {
3133
if (engine_object->ce->type == ZEND_INTERNAL_CLASS) {
3234
/* Internal classes always php_random_engine struct */

Diff for: ext/shmop/shmop.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@
3333
#include "tsrm_win32.h"
3434
#endif
3535

36-
3736
#ifdef HAVE_SHMOP
3837

3938
#include "ext/standard/info.h"
4039

40+
#include <errno.h>
41+
#include <string.h> // for strerror()
42+
4143
/* {{{ shmop_module_entry */
4244
zend_module_entry shmop_module_entry = {
4345
STANDARD_MODULE_HEADER,

Diff for: ext/soap/php_encoding.c

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include "zend_strtod.h"
2626
#include "zend_interfaces.h"
2727

28+
#include <errno.h>
29+
2830
/* zval type decode */
2931
static zval *to_zval_double(zval* ret, encodeTypePtr type, xmlNodePtr data);
3032
static zval *to_zval_long(zval* ret, encodeTypePtr type, xmlNodePtr data);

Diff for: ext/sockets/conversions.c

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
# include <stdint.h>
2525
#endif
2626

27+
#include <errno.h>
2728
#include <limits.h>
2829
#include <stdarg.h>
2930
#include <stddef.h>

Diff for: ext/sockets/multicast.c

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "sockaddr_conv.h"
4040
#include "main/php_network.h"
4141

42+
#include <errno.h>
4243

4344
enum source_op {
4445
JOIN_SOURCE,

Diff for: ext/sockets/sendrecvmsg.c

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <TSRM/TSRM.h>
2929
#endif
3030

31+
#include <errno.h>
32+
3133
#define MAX_USER_BUFF_SIZE ((size_t)(100*1024*1024))
3234
#define DEFAULT_BUFF_SIZE 8192
3335
#define MAX_ARRAY_KEY_SIZE 128

Diff for: ext/sockets/sockaddr_conv.c

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifdef PHP_WIN32
66
#include "windows_common.h"
77
#else
8+
#include <errno.h>
89
#include <netdb.h>
910
#include <arpa/inet.h>
1011
#endif

Diff for: ext/spl/spl_directory.c

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
#include "spl_directory_arginfo.h"
3737
#include "spl_exceptions.h"
3838

39+
#include <errno.h>
40+
#include <string.h> // for strerror()
41+
3942
#define SPL_HAS_FLAG(flags, test_flag) ((flags & test_flag) ? 1 : 0)
4043

4144
/* declare the class handlers */

Diff for: ext/standard/array.c

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "zend_smart_str.h"
4141
#include "zend_bitset.h"
4242
#include "zend_exceptions.h"
43+
#include "zend_strtod.h"
4344
#include "ext/spl/spl_array.h"
4445
#include "ext/random/php_random.h"
4546

Diff for: ext/standard/basic_functions.c

+4
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ PHPAPI php_basic_globals basic_globals;
117117
#include "streamsfuncs.h"
118118
#include "basic_functions_arginfo.h"
119119

120+
#if defined(HAVE_NANOSLEEP) || !defined(PHP_WIN32)
121+
#include <errno.h>
122+
#endif
123+
120124
typedef struct _user_tick_function_entry {
121125
zend_fcall_info fci;
122126
zend_fcall_info_cache fci_cache;

Diff for: ext/standard/dns.c

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ extern void __res_ndestroy(res_state statp);
5757
#endif
5858
#endif
5959

60+
#include <errno.h>
61+
#include <string.h> // for strerror()
62+
6063
#ifndef MAXHOSTNAMELEN
6164
#define MAXHOSTNAMELEN 255
6265
#endif

Diff for: ext/standard/exec.c

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
#include <unistd.h>
4747
#endif
4848

49+
#ifdef HAVE_NICE
50+
#include <errno.h>
51+
#endif
52+
4953
#include <limits.h>
5054

5155
#ifdef PHP_WIN32

Diff for: ext/standard/formatted_print.c

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "ext/standard/head.h"
2020
#include "php_string.h"
2121
#include "zend_execute.h"
22+
#include "zend_strtod.h" // for zend_gcvt()
2223
#include <stdio.h>
2324

2425
#include <locale.h>

Diff for: ext/standard/ftok.c

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#endif
2828

2929
#ifdef HAVE_FTOK
30+
31+
#include <errno.h>
32+
#include <string.h> // for strerror()
33+
3034
/* {{{ Convert a pathname and a project identifier to a System V IPC key */
3135
PHP_FUNCTION(ftok)
3236
{

Diff for: ext/standard/hrtime.c

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "php.h"
1919
#include "hrtime.h"
20+
#include "zend_strtod.h"
2021

2122
/* {{{ */
2223
/* This file reuses code parts from the cross-platform timer library

Diff for: ext/standard/mail.c

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444

4545
#ifdef PHP_WIN32
4646
# include "win32/sendmail.h"
47+
#else
48+
# include <errno.h>
4749
#endif
4850

4951
#define SKIP_LONG_HEADER_SEP(str, pos) \

Diff for: ext/standard/math.c

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "zend_exceptions.h"
2424
#include "zend_portability.h"
2525
#include "zend_bitset.h"
26+
#include "zend_strtod.h"
2627

2728
#include <math.h>
2829
#include <float.h>

Diff for: ext/standard/net.c

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
# include <netdb.h>
4848
#endif
4949

50+
#include <errno.h>
51+
#include <string.h> // for strerror()
52+
5053
PHPAPI zend_string* php_inet_ntop(const struct sockaddr *addr) {
5154
socklen_t addrlen = sizeof(struct sockaddr_in);
5255

Diff for: ext/standard/php_fopen_wrapper.c

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#include "php_fopen_wrappers.h"
3030
#include "SAPI.h"
3131

32+
#include <errno.h>
33+
#include <string.h> // for strerror()
34+
3235
static ssize_t php_stream_output_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
3336
{
3437
PHPWRITE(buf, count);

Diff for: ext/standard/proc_open.c

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
#include <fcntl.h>
3737
#endif
3838

39+
#include <errno.h>
40+
#include <string.h> // for strerror()
41+
3942
/* This symbol is defined in ext/standard/config.m4.
4043
* Essentially, it is set if you HAVE_FORK || PHP_WIN32
4144
* Other platforms may modify that configure check and add suitable #ifdefs

Diff for: ext/standard/streamsfuncs.c

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ typedef unsigned long long php_timeout_ull;
4040
typedef unsigned __int64 php_timeout_ull;
4141
#endif
4242

43+
#include <errno.h>
44+
#include <string.h> // for strerror()
45+
4346
#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)))
4447

4548
static php_stream_context *decode_context_param(zval *contextresource);

Diff for: ext/standard/var.c

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "php_incomplete_class.h"
2929
#include "zend_enum.h"
3030
#include "zend_exceptions.h"
31+
#include "zend_strtod.h" // for zend_gcvt()
3132
/* }}} */
3233

3334
struct php_serialize_data {

Diff for: ext/standard/var_unserializer.re

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "php_incomplete_class.h"
2020
#include "zend_portability.h"
2121
#include "zend_exceptions.h"
22+
#include "zend_strtod.h"
2223

2324
/* {{{ reference-handling for unserializer: var_* */
2425
#define VAR_ENTRIES_MAX 1018 /* 1024 - offsetof(php_unserialize_data, entries) / sizeof(void*) */

Diff for: ext/sysvmsg/sysvmsg.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
#include "php_globals.h"
2323
#include "ext/standard/info.h"
2424
#include "php_sysvmsg.h"
25-
#include "sysvmsg_arginfo.h"
2625
#include "ext/standard/php_var.h"
2726
#include "zend_smart_str.h"
2827

28+
#include <errno.h>
29+
#include "sysvmsg_arginfo.h"
30+
31+
#include <string.h> // for strerror()
2932
#include <sys/types.h>
3033
#include <sys/ipc.h>
3134
#include <sys/msg.h>

0 commit comments

Comments
 (0)