]> granicus.if.org Git - php/commitdiff
Fix MSVC level 1 (severe) warnings
authorChristoph M. Becker <cmbecker69@gmx.de>
Wed, 27 May 2020 07:58:10 +0000 (09:58 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 5 Jun 2020 09:17:05 +0000 (11:17 +0200)
We fix (hopefully) all instances of:

* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312>

`zend_llist_add_element()` and `zend_llist_prepend_element()` now
explicitly expect a *const* pointer.

We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress
C4090; this should prevent accidential removal of the cast by
clarifying the intention, and makes it easier to remove the casts if
the issue[1] will be resolved sometime.

[1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>

27 files changed:
TSRM/tsrm_win32.c
TSRM/tsrm_win32.h
Zend/zend_llist.c
Zend/zend_llist.h
Zend/zend_portability.h
Zend/zend_virtual_cwd.c
ext/com_dotnet/com_handlers.c
ext/mbstring/mbstring.c
ext/mysqlnd/mysqlnd_auth.c
ext/opcache/jit/zend_jit_trace.c
ext/opcache/jit/zend_jit_vm_helpers.c
ext/opcache/jit/zend_jit_x86.dasc
ext/pdo_odbc/odbc_driver.c
ext/session/session.c
ext/snmp/snmp.c
ext/standard/proc_open.c
ext/standard/string.c
ext/zend_test/config.w32
ext/zend_test/php_test.h
ext/zend_test/test.c
sapi/apache2handler/apache_config.c
sapi/apache2handler/mod_php.c
sapi/apache2handler/php_functions.c
sapi/apache2handler/sapi_apache2.c
sapi/phpdbg/phpdbg.c
sapi/phpdbg/phpdbg_prompt.c
win32/winutil.c

index 05c47d146aa3ed0bf56f94b83cdd5803934a6d03..15659ba5464968883590d32cc2a7e6caf3a11929 100644 (file)
@@ -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;
index c16006512a4ca87d8ef1fd681e952fac4de7918f..e002032218e8267aea0c3ca5c6c56084900c5aff 100644 (file)
@@ -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);
index 4a2c22e6321238a7e4879c9cfddd5a27424d94b0..78a3310438f03185734f8a96f5c61173044a06b2 100644 (file)
@@ -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);
 
index b9155ce6cb195833b95481a000499321d4cc2fca..e9b5b1d1fb440d83bccb28da343b33aae9cabd78 100644 (file)
@@ -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);
index f1d1ff12093087d871c8ab6a44c580f9bbaf3ec1..023fcd0510c4f54e1904198e576efe82ef5450e9 100644 (file)
@@ -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 */
index a2f1e075e5037ef4a5d375c1e06cd4407e672eb6..ac3d6773b15bcf3490ac7f023cd5c9b593bf7810 100644 (file)
@@ -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) {
index e6434e52cfeb0a8629a0796cb50a0883c3bc712e..4ff80d96e929218aabb5547aabf4b0c63dc0a62a 100644 (file)
@@ -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;
index 779ba3417e49e073a514c52bb187e489a16ac3bc..a30c3ca99ca51c2d00866d14d6c58f20ac7d9767 100644 (file)
@@ -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;
index e947e4b253b1b587eed6a9e9202d673a45c20092..81700ca86b2bd965f96878f260ebe9d1bb6ebc9f 100644 (file)
@@ -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;
index d0430ccef5f60f0568572f38d7c9ef9aedf5cbf3..6ef8f084b6f675214c0eb387c0cc7355b57c1f46 100644 (file)
@@ -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;
index 770251e0faad7a78cf8d23fad251e2ea7b92ae18..00f2d5bb255e229e40f2e8a59b6582c6ad7cb152 100644 (file)
@@ -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);
index 06f83cb6d2e6da3f6eff699c99b7853c55330268..e107bfb65946edfac0a9bcbddb0f4fb0325d64d5 100644 (file)
@@ -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;
index d0441e98a92872cce51bc84ab6f86facf0f2699e..5b35455ede1b3e05e0fe22b472b364bb29533b51 100644 (file)
@@ -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;
index 8b97bb62ad35e33a56d42744d395163217c5cbce..220bfe3638deb9025aeedf667c75f5d51353f142 100644 (file)
@@ -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;
 }
index d5cf7cce04a7d9058d11a5df0f0e38962b916ff0..9d9f231b19745372b6eba7e45a0fcc356277692c 100644 (file)
@@ -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();
        }
 
index 0e374240b84ec42dbac1d699bb52a4c7b23db97a..ba9fbbaa41476900e4fac2380de4d0536dcbd746 100644 (file)
@@ -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)
 {
index 7729acf4512144a6c6dddd024edfee3b4d845ca8..06ad0f2d24973f0d0446576ae787e6f1183c361e 100644 (file)
@@ -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);
index 76a0f1ae5ba8e1f2c70fcfe377116078cf4c853e..d66fd0b1ee4d53dc8657fb54c76483c32e6ee7a5 100644 (file)
@@ -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 ");
 }
index 834c380362dfdf80a6775eb4e620a7a54bb0f437..5d9e31cc8361019b6a5aa927e6946e3f960dd229 100644 (file)
@@ -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
index 69b6196ab6622b5ae4fef746643699744245faee..d6fef0f1b468da6915ef15378c3f68aba9619aa6 100644 (file)
@@ -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++) {
index b7e0077d2d8ba9949d027ecbf1fb3694f117fd02..0079ac7fea18182e66e543f631304c98c92c417f 100644 (file)
 #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"
 
index 835c5f5c90d103adcf24e5130276e97b73f8a475..e8e97fabeb9bfd60282d91943c254e77b6de3377 100644 (file)
 #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 = {
index ae0a8553b423ec9cc66a5c0499e94da7bb68b335..834a079ee855ffcebb41d1d46aebeb9a550382b7 100644 (file)
 #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"
index b2f32ce49a1ab25386834ab82f2a76b8d1fa5974..52bc44f94a9c132bdb30e6e07eff8d669358e946 100644 (file)
 #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"
index f9777c5adbdb684a6107bd81057fb1303e36d014..78aa34f524d8f4b7bdc5c25660f547d7095845af 100644 (file)
@@ -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);
index 3c26fa7ef4ff969a6279e32b3c1bbd677299bbb8..14e09d72432f8b9311b4b47d4a7acd5fa0eddec9 100644 (file)
@@ -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
 
index a886964bf0a9653dc22c2f4423944719ca3cacd9..40664a9e038cd58a40b58fd7262532cfa524176f 100644 (file)
@@ -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;
        }