summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TSRM/tsrm_win32.c2
-rw-r--r--TSRM/tsrm_win32.h2
-rw-r--r--Zend/zend_llist.c4
-rw-r--r--Zend/zend_llist.h4
-rw-r--r--Zend/zend_portability.h7
-rw-r--r--Zend/zend_virtual_cwd.c4
-rw-r--r--ext/com_dotnet/com_handlers.c6
-rw-r--r--ext/mbstring/mbstring.c40
-rw-r--r--ext/mysqlnd/mysqlnd_auth.c2
-rw-r--r--ext/opcache/jit/zend_jit_trace.c4
-rw-r--r--ext/opcache/jit/zend_jit_vm_helpers.c2
-rw-r--r--ext/opcache/jit/zend_jit_x86.dasc2
-rw-r--r--ext/pdo_odbc/odbc_driver.c2
-rw-r--r--ext/session/session.c2
-rw-r--r--ext/snmp/snmp.c2
-rw-r--r--ext/standard/proc_open.c2
-rw-r--r--ext/standard/string.c2
-rw-r--r--ext/zend_test/config.w321
-rw-r--r--ext/zend_test/php_test.h14
-rw-r--r--ext/zend_test/test.c4
-rw-r--r--sapi/apache2handler/apache_config.c6
-rw-r--r--sapi/apache2handler/mod_php.c6
-rw-r--r--sapi/apache2handler/php_functions.c6
-rw-r--r--sapi/apache2handler/sapi_apache2.c6
-rw-r--r--sapi/phpdbg/phpdbg.c2
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c2
-rw-r--r--win32/winutil.c2
27 files changed, 91 insertions, 47 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 05c47d146a..15659ba546 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -103,7 +103,7 @@ TSRM_API void tsrm_win32_shutdown(void)
#endif
}/*}}}*/
-char * tsrm_win32_get_path_sid_key(const char *pathname, size_t pathname_len, size_t *key_len)
+const char * tsrm_win32_get_path_sid_key(const char *pathname, size_t pathname_len, size_t *key_len)
{/*{{{*/
PSID pSid = TWG(impersonation_token_sid);
char *ptcSid = NULL;
diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h
index c16006512a..e002032218 100644
--- a/TSRM/tsrm_win32.h
+++ b/TSRM/tsrm_win32.h
@@ -89,7 +89,7 @@ TSRMLS_CACHE_EXTERN()
#define SHM_RND FILE_MAP_WRITE
#define SHM_REMAP FILE_MAP_COPY
-char * tsrm_win32_get_path_sid_key(const char *pathname, size_t pathname_len, size_t *key_len);
+const char * tsrm_win32_get_path_sid_key(const char *pathname, size_t pathname_len, size_t *key_len);
TSRM_API void tsrm_win32_startup(void);
TSRM_API void tsrm_win32_shutdown(void);
diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c
index 4a2c22e632..78a3310438 100644
--- a/Zend/zend_llist.c
+++ b/Zend/zend_llist.c
@@ -31,7 +31,7 @@ ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor
l->persistent = persistent;
}
-ZEND_API void zend_llist_add_element(zend_llist *l, void *element)
+ZEND_API void zend_llist_add_element(zend_llist *l, const void *element)
{
zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent);
@@ -49,7 +49,7 @@ ZEND_API void zend_llist_add_element(zend_llist *l, void *element)
}
-ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element)
+ZEND_API void zend_llist_prepend_element(zend_llist *l, const void *element)
{
zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent);
diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h
index b9155ce6cb..e9b5b1d1fb 100644
--- a/Zend/zend_llist.h
+++ b/Zend/zend_llist.h
@@ -46,8 +46,8 @@ typedef zend_llist_element* zend_llist_position;
BEGIN_EXTERN_C()
ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent);
-ZEND_API void zend_llist_add_element(zend_llist *l, void *element);
-ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element);
+ZEND_API void zend_llist_add_element(zend_llist *l, const void *element);
+ZEND_API void zend_llist_prepend_element(zend_llist *l, const void *element);
ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2));
ZEND_API void zend_llist_destroy(zend_llist *l);
ZEND_API void zend_llist_clean(zend_llist *l);
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index f1d1ff1209..023fcd0510 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -621,4 +621,11 @@ extern "C++" {
# define ZEND_IGNORE_LEAKS_END()
#endif
+/* MSVC yields C4090 when a (const T **) is passed to a (void *); ZEND_VOIDP works around that */
+#ifdef _MSC_VER
+# define ZEND_VOIDP(ptr) ((void *) ptr)
+#else
+# define ZEND_VOIDP(ptr) (ptr)
+#endif
+
#endif /* ZEND_PORTABILITY_H */
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index a2f1e075e5..ac3d6773b1 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -303,8 +303,8 @@ static inline zend_ulong realpath_cache_key(const char *path, size_t path_len) /
{
register zend_ulong h;
size_t bucket_key_len;
- char *bucket_key_start = tsrm_win32_get_path_sid_key(path, path_len, &bucket_key_len);
- char *bucket_key = (char *)bucket_key_start;
+ const char *bucket_key_start = tsrm_win32_get_path_sid_key(path, path_len, &bucket_key_len);
+ const char *bucket_key = bucket_key_start;
const char *e;
if (!bucket_key) {
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c
index e6434e52cf..4ff80d96e9 100644
--- a/ext/com_dotnet/com_handlers.c
+++ b/ext/com_dotnet/com_handlers.c
@@ -177,7 +177,7 @@ static void com_write_dimension(zend_object *object, zval *offset, zval *value)
}
}
-static zval *com_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot)
+static zval *com_get_property_ptr_ptr(zend_object *object, zend_string *member, int type, void **cache_slot)
{
return NULL;
}
@@ -224,10 +224,10 @@ static HashTable *com_properties_get(zend_object *object)
* infinite recursion when the hash is displayed via var_dump().
* Perhaps it is best to leave it un-implemented.
*/
- return &zend_empty_array;
+ return (HashTable *) &zend_empty_array;
}
-static HashTable *com_get_gc(zval *object, zval **table, int *n)
+static HashTable *com_get_gc(zend_object *object, zval **table, int *n)
{
*table = NULL;
*n = 0;
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 779ba3417e..a30c3ca99c 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -365,7 +365,7 @@ static int php_mb_parse_encoding_list(const char *value, size_t value_length,
zend_argument_value_error(arg_num, "contains invalid encoding \"%s\"", p1);
}
efree(tmpstr);
- pefree(list, persistent);
+ pefree(ZEND_VOIDP(list), persistent);
return FAILURE;
}
@@ -400,7 +400,7 @@ static int php_mb_parse_encoding_array(HashTable *target_hash, const mbfl_encodi
ZEND_HASH_FOREACH_VAL(target_hash, hash_entry) {
zend_string *encoding_str = zval_try_get_string(hash_entry);
if (UNEXPECTED(!encoding_str)) {
- efree(list);
+ efree(ZEND_VOIDP(list));
return FAILURE;
}
@@ -424,7 +424,7 @@ static int php_mb_parse_encoding_array(HashTable *target_hash, const mbfl_encodi
} else {
zend_argument_value_error(arg_num, "contains invalid encoding \"%s\"", ZSTR_VAL(encoding_str));
zend_string_release(encoding_str);
- efree(list);
+ efree(ZEND_VOIDP(list));
return FAILURE;
}
}
@@ -809,7 +809,7 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order)
if (!new_value) {
if (MBSTRG(detect_order_list)) {
- pefree(MBSTRG(detect_order_list), 1);
+ pefree(ZEND_VOIDP(MBSTRG(detect_order_list)), 1);
}
MBSTRG(detect_order_list) = NULL;
MBSTRG(detect_order_list_size) = 0;
@@ -821,7 +821,7 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order)
}
if (MBSTRG(detect_order_list)) {
- pefree(MBSTRG(detect_order_list), 1);
+ pefree(ZEND_VOIDP(MBSTRG(detect_order_list)), 1);
}
MBSTRG(detect_order_list) = list;
MBSTRG(detect_order_list_size) = size;
@@ -836,7 +836,7 @@ static int _php_mb_ini_mbstring_http_input_set(const char *new_value, size_t new
return FAILURE;
}
if (MBSTRG(http_input_list)) {
- pefree(MBSTRG(http_input_list), 1);
+ pefree(ZEND_VOIDP(MBSTRG(http_input_list)), 1);
}
MBSTRG(http_input_list) = list;
MBSTRG(http_input_list_size) = size;
@@ -1128,10 +1128,10 @@ ZEND_TSRMLS_CACHE_UPDATE();
static PHP_GSHUTDOWN_FUNCTION(mbstring)
{
if (mbstring_globals->http_input_list) {
- free(mbstring_globals->http_input_list);
+ free(ZEND_VOIDP(mbstring_globals->http_input_list));
}
if (mbstring_globals->detect_order_list) {
- free(mbstring_globals->detect_order_list);
+ free(ZEND_VOIDP(mbstring_globals->detect_order_list));
}
if (mbstring_globals->http_output_conv_mimetypes) {
_php_mb_free_regex(mbstring_globals->http_output_conv_mimetypes);
@@ -1236,7 +1236,7 @@ PHP_RINIT_FUNCTION(mbstring)
PHP_RSHUTDOWN_FUNCTION(mbstring)
{
if (MBSTRG(current_detect_order_list) != NULL) {
- efree(MBSTRG(current_detect_order_list));
+ efree(ZEND_VOIDP(MBSTRG(current_detect_order_list)));
MBSTRG(current_detect_order_list) = NULL;
MBSTRG(current_detect_order_list_size) = 0;
}
@@ -1510,13 +1510,13 @@ PHP_FUNCTION(mb_detect_order)
}
if (size == 0) {
- efree(list);
+ efree(ZEND_VOIDP(list));
zend_argument_value_error(1, "must specify at least one encoding");
RETURN_THROWS();
}
if (MBSTRG(current_detect_order_list)) {
- efree(MBSTRG(current_detect_order_list));
+ efree(ZEND_VOIDP(MBSTRG(current_detect_order_list)));
}
MBSTRG(current_detect_order_list) = list;
MBSTRG(current_detect_order_list_size) = size;
@@ -2632,7 +2632,7 @@ PHP_FUNCTION(mb_convert_encoding)
}
if (!num_from_encodings) {
- efree(from_encodings);
+ efree(ZEND_VOIDP(from_encodings));
zend_argument_value_error(3, "must specify at least one encoding");
RETURN_THROWS();
}
@@ -2658,7 +2658,7 @@ PHP_FUNCTION(mb_convert_encoding)
}
if (free_from_encodings) {
- efree(from_encodings);
+ efree(ZEND_VOIDP(from_encodings));
}
}
/* }}} */
@@ -2811,7 +2811,7 @@ PHP_FUNCTION(mb_detect_encoding)
}
if (size == 0) {
- efree(elist);
+ efree(ZEND_VOIDP(elist));
zend_argument_value_error(2, "must specify at least one encoding");
RETURN_THROWS();
}
@@ -2826,7 +2826,7 @@ PHP_FUNCTION(mb_detect_encoding)
ret = mbfl_identify_encoding(&string, elist, size, strict);
if (free_elist) {
- efree(elist);
+ efree(ZEND_VOIDP(elist));
}
if (ret == NULL) {
@@ -3191,7 +3191,7 @@ PHP_FUNCTION(mb_convert_variables)
}
if (elistsz == 0) {
- efree(elist);
+ efree(ZEND_VOIDP(elist));
zend_argument_value_error(2, "must specify at least one encoding");
RETURN_THROWS();
}
@@ -3213,7 +3213,7 @@ PHP_FUNCTION(mb_convert_variables)
from_encoding = mbfl_encoding_detector_judge(identd);
mbfl_encoding_detector_delete(identd);
if (recursion_error) {
- efree(elist);
+ efree(ZEND_VOIDP(elist));
php_error_docref(NULL, E_WARNING, "Cannot handle recursive references");
RETURN_FALSE;
}
@@ -3221,12 +3221,12 @@ PHP_FUNCTION(mb_convert_variables)
if (!from_encoding) {
php_error_docref(NULL, E_WARNING, "Unable to detect encoding");
- efree(elist);
+ efree(ZEND_VOIDP(elist));
RETURN_FALSE;
}
}
- efree(elist);
+ efree(ZEND_VOIDP(elist));
convd = mbfl_buffer_converter_new(from_encoding, to_encoding, 0);
/* If this assertion fails this means some memory allocation failure which is a bug */
@@ -4338,7 +4338,7 @@ static void php_mb_populate_current_detect_order_list(void)
if (MBSTRG(detect_order_list) && MBSTRG(detect_order_list_size)) {
nentries = MBSTRG(detect_order_list_size);
entry = (const mbfl_encoding **)safe_emalloc(nentries, sizeof(mbfl_encoding*), 0);
- memcpy(entry, MBSTRG(detect_order_list), sizeof(mbfl_encoding*) * nentries);
+ memcpy(ZEND_VOIDP(entry), MBSTRG(detect_order_list), sizeof(mbfl_encoding*) * nentries);
} else {
const enum mbfl_no_encoding *src = MBSTRG(default_detect_order_list);
size_t i;
diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c
index e947e4b253..81700ca86b 100644
--- a/ext/mysqlnd/mysqlnd_auth.c
+++ b/ext/mysqlnd/mysqlnd_auth.c
@@ -752,7 +752,7 @@ static mysqlnd_rsa_t
mysqlnd_sha256_get_rsa_from_pem(const char *buf, size_t len)
{
BCRYPT_KEY_HANDLE ret = 0;
- LPCSTR der_buf = NULL;
+ LPSTR der_buf = NULL;
DWORD der_len;
CERT_PUBLIC_KEY_INFO *key_info = NULL;
DWORD key_info_len;
diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c
index d0430ccef5..6ef8f084b6 100644
--- a/ext/opcache/jit/zend_jit_trace.c
+++ b/ext/opcache/jit/zend_jit_trace.c
@@ -1961,7 +1961,7 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace
memset(start, -1, sizeof(int) * ssa->vars_count * 2);
memset(flags, 0, sizeof(uint8_t) * ssa->vars_count);
- memset(vars_op_array, 0, sizeof(zend_op_array*) * ssa->vars_count);
+ memset(ZEND_VOIDP(vars_op_array), 0, sizeof(zend_op_array*) * ssa->vars_count);
op_array = trace_buffer->op_array;
jit_extension =
@@ -5353,7 +5353,7 @@ static int zend_jit_setup_hot_trace_counters(zend_op_array *op_array)
static void zend_jit_trace_init_caches(void)
{
- memset(JIT_G(bad_root_cache_opline), 0, sizeof(JIT_G(bad_root_cache_opline)));
+ memset(ZEND_VOIDP(JIT_G(bad_root_cache_opline)), 0, sizeof(JIT_G(bad_root_cache_opline)));
memset(JIT_G(bad_root_cache_count), 0, sizeof(JIT_G(bad_root_cache_count)));
memset(JIT_G(bad_root_cache_stop), 0, sizeof(JIT_G(bad_root_cache_count)));
JIT_G(bad_root_slot) = 0;
diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c
index 770251e0fa..00f2d5bb25 100644
--- a/ext/opcache/jit/zend_jit_vm_helpers.c
+++ b/ext/opcache/jit/zend_jit_vm_helpers.c
@@ -183,7 +183,7 @@ ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_profile_helper(ZEND_OPCODE_HANDLE
{
zend_op_array *op_array = (zend_op_array*)EX(func);
zend_jit_op_array_extension *jit_extension = (zend_jit_op_array_extension*)ZEND_FUNC_INFO(op_array);
- zend_vm_opcode_handler_t handler = jit_extension->orig_handler;
+ zend_vm_opcode_handler_t handler = (zend_vm_opcode_handler_t) jit_extension->orig_handler;
++*(uintptr_t*)(EX(run_time_cache) + zend_jit_profile_counter_rid);
++zend_jit_profile_counter;
ZEND_OPCODE_TAIL_CALL(handler);
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index 06f83cb6d2..e107bfb659 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -2607,7 +2607,7 @@ static int zend_jit_setup(void)
/* To find offset of "_tsrm_ls_cache" in TLS segment we perform a linear scan of local TLS memory */
/* Probably, it might be better solution */
do {
- void ***tls_mem = ((void***)__readgsqword(0x58))[_tls_index];
+ void ***tls_mem = ((void**)__readgsqword(0x58))[_tls_index];
void *val = _tsrm_ls_cache;
size_t offset = 0;
size_t size = (char*)&_tls_end - (char*)&_tls_start;
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
index d0441e98a9..5b35455ede 100644
--- a/ext/pdo_odbc/odbc_driver.c
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -420,7 +420,7 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
}
rc = SQLSetConnectAttr(H->dbc, SQL_ATTR_AUTOCOMMIT,
- (SQLPOINTER)(dbh->auto_commit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF), SQL_IS_INTEGER);
+ (SQLPOINTER)(intptr_t)(dbh->auto_commit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF), SQL_IS_INTEGER);
if (rc != SQL_SUCCESS) {
pdo_odbc_drv_error("SQLSetConnectAttr AUTOCOMMIT");
goto fail;
diff --git a/ext/session/session.c b/ext/session/session.c
index 8b97bb62ad..220bfe3638 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2821,7 +2821,7 @@ static PHP_MSHUTDOWN_FUNCTION(session) /* {{{ */
}
ps_serializers[PREDEFINED_SERIALIZERS].name = NULL;
- memset(&ps_modules[PREDEFINED_MODULES], 0, (MAX_MODULES-PREDEFINED_MODULES)*sizeof(ps_module *));
+ memset(ZEND_VOIDP(&ps_modules[PREDEFINED_MODULES]), 0, (MAX_MODULES-PREDEFINED_MODULES)*sizeof(ps_module *));
return SUCCESS;
}
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index d5cf7cce04..9d9f231b19 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1507,7 +1507,7 @@ PHP_METHOD(SNMP, __construct)
case SNMP_VERSION_3:
break;
default:
- zend_argument_value_error(zend_ce_exception, 1, "must be a valid SNMP protocol version");
+ zend_argument_value_error(1, "must be a valid SNMP protocol version");
RETURN_THROWS();
}
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 0e374240b8..ba9fbbaa41 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -841,6 +841,7 @@ static int set_proc_descriptor_from_resource(zval *resource, descriptorspec_item
return SUCCESS;
}
+#ifndef PHP_WIN32
static int close_parentends_of_pipes(descriptorspec_item *descriptors, int ndesc)
{
/* We are running in child process
@@ -863,6 +864,7 @@ static int close_parentends_of_pipes(descriptorspec_item *descriptors, int ndesc
return SUCCESS;
}
+#endif
static void close_all_descriptors(descriptorspec_item *descriptors, int ndesc)
{
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 7729acf451..06ad0f2d24 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1109,7 +1109,7 @@ PHPAPI void php_explode_negative_limit(const zend_string *delim, zend_string *st
do {
if (found >= allocated) {
allocated = found + EXPLODE_ALLOC_STEP;/* make sure we have enough memory */
- positions = erealloc(positions, allocated*sizeof(char *));
+ positions = erealloc(ZEND_VOIDP(positions), allocated*sizeof(char *));
}
positions[found++] = p1 = p2 + ZSTR_LEN(delim);
p2 = php_memnstr(p1, ZSTR_VAL(delim), ZSTR_LEN(delim), endp);
diff --git a/ext/zend_test/config.w32 b/ext/zend_test/config.w32
index 76a0f1ae5b..d66fd0b1ee 100644
--- a/ext/zend_test/config.w32
+++ b/ext/zend_test/config.w32
@@ -4,4 +4,5 @@ ARG_ENABLE("zend-test", "enable zend-test extension", "no");
if (PHP_ZEND_TEST != "no") {
EXTENSION("zend_test", "test.c", PHP_ZEND_TEST_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
+ ADD_FLAG("CFLAGS_ZEND_TEST", "/D PHP_ZEND_TEST_EXPORTS ");
}
diff --git a/ext/zend_test/php_test.h b/ext/zend_test/php_test.h
index 834c380362..5d9e31cc83 100644
--- a/ext/zend_test/php_test.h
+++ b/ext/zend_test/php_test.h
@@ -35,7 +35,17 @@ struct bug79096 {
uint64_t b;
};
-ZEND_API struct bug79096 bug79096(void);
-ZEND_API void bug79532(off_t *array, size_t elems);
+#ifdef PHP_WIN32
+# ifdef PHP_ZEND_TEST_EXPORTS
+# define PHP_ZEND_TEST_API __declspec(dllexport)
+# else
+# define PHP_ZEND_TEST_API __declspec(dllimport)
+# endif
+#else
+# define PHP_ZEND_TEST_API ZEND_API
+#endif
+
+PHP_ZEND_TEST_API struct bug79096 bug79096(void);
+PHP_ZEND_TEST_API void bug79532(off_t *array, size_t elems);
#endif
diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c
index 69b6196ab6..d6fef0f1b4 100644
--- a/ext/zend_test/test.c
+++ b/ext/zend_test/test.c
@@ -335,7 +335,7 @@ ZEND_TSRMLS_CACHE_DEFINE()
ZEND_GET_MODULE(zend_test)
#endif
-struct bug79096 bug79096(void)
+PHP_ZEND_TEST_API struct bug79096 bug79096(void)
{
struct bug79096 b;
@@ -344,7 +344,7 @@ struct bug79096 bug79096(void)
return b;
}
-void bug79532(off_t *array, size_t elems)
+PHP_ZEND_TEST_API void bug79532(off_t *array, size_t elems)
{
int i;
for (i = 0; i < elems; i++) {
diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c
index b7e0077d2d..0079ac7fea 100644
--- a/sapi/apache2handler/apache_config.c
+++ b/sapi/apache2handler/apache_config.c
@@ -17,6 +17,12 @@
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
#include "php.h"
+#ifdef strcasecmp
+# undef strcasecmp
+#endif
+#ifdef strncasecmp
+# undef strncasecmp
+#endif
#include "php_ini.h"
#include "php_apache.h"
diff --git a/sapi/apache2handler/mod_php.c b/sapi/apache2handler/mod_php.c
index 835c5f5c90..e8e97fabeb 100644
--- a/sapi/apache2handler/mod_php.c
+++ b/sapi/apache2handler/mod_php.c
@@ -19,6 +19,12 @@
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
#include "php.h"
+#ifdef strcasecmp
+# undef strcasecmp
+#endif
+#ifdef strncasecmp
+# undef strncasecmp
+#endif
#include "php_apache.h"
AP_MODULE_DECLARE_DATA module php_module = {
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index ae0a8553b4..834a079ee8 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -17,6 +17,12 @@
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
#include "php.h"
+#ifdef strcasecmp
+# undef strcasecmp
+#endif
+#ifdef strncasecmp
+# undef strncasecmp
+#endif
#include "zend_smart_str.h"
#include "ext/standard/info.h"
#include "ext/standard/head.h"
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index b2f32ce49a..52bc44f94a 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -19,6 +19,12 @@
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
#include "php.h"
+#ifdef strcasecmp
+# undef strcasecmp
+#endif
+#ifdef strncasecmp
+# undef strncasecmp
+#endif
#include "php_main.h"
#include "php_ini.h"
#include "php_variables.h"
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index f9777c5adb..78aa34f524 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -2071,7 +2071,7 @@ phpdbg_out:
settings->oplog = PHPDBG_G(oplog);
settings->prompt[0] = PHPDBG_G(prompt)[0];
settings->prompt[1] = PHPDBG_G(prompt)[1];
- memcpy(settings->colors, PHPDBG_G(colors), sizeof(settings->colors));
+ memcpy(ZEND_VOIDP(settings->colors), PHPDBG_G(colors), sizeof(settings->colors));
settings->eol = PHPDBG_G(eol);
settings->input_buflen = PHPDBG_G(input_buflen);
memcpy(settings->input_buffer, PHPDBG_G(input_buffer), settings->input_buflen);
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 3c26fa7ef4..14e09d7243 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -1707,7 +1707,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
#ifdef ZEND_WIN32
if (EG(timed_out)) {
- zend_timeout(0);
+ zend_timeout();
}
#endif
diff --git a/win32/winutil.c b/win32/winutil.c
index a886964bf0..40664a9e03 100644
--- a/win32/winutil.c
+++ b/win32/winutil.c
@@ -439,7 +439,7 @@ PHP_WINUTIL_API char *php_win32_get_username(void)
static zend_always_inline BOOL is_compatible(const char *name, BOOL is_smaller, char *format, char **err)
{/*{{{*/
/* work around ImageLoad() issue */
- char *name_stripped = name;
+ const char *name_stripped = name;
if (name[0] == '.' && IS_SLASH(name[1])) {
name_stripped += 2;
}