]> granicus.if.org Git - php/commitdiff
basic clang compatibility on windows
authorAnatol Belski <ab@php.net>
Thu, 6 Nov 2014 19:42:46 +0000 (20:42 +0100)
committerAnatol Belski <ab@php.net>
Fri, 7 Nov 2014 09:17:59 +0000 (10:17 +0100)
Zend/zend_hash.c
Zend/zend_portability.h
ext/standard/basic_functions.h

index 3cd5d6aa5f9d942eed7b30551686536bd9e4dd18..5577194b0c796fbba5aaf9c6b07468df0d41082b 100644 (file)
@@ -100,7 +100,7 @@ static const uint32_t uninitialized_bucket = {INVALID_IDX};
 ZEND_API void _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
 {
        /* Use big enough power of 2 */
-#ifdef PHP_WIN32
+#if defined(PHP_WIN32) && !defined(__clang__)
        if (nSize <= 8) {
                ht->nTableSize = 8;
        } else if (nSize >= 0x80000000) {
index c159fdc77b417aa61a945f9d150e60f6a66dff61..a6dac42b5a291adc3fadb2fc443de0b5f94e8993 100644 (file)
 # include <alloca.h>
 #endif
 
+#if defined(ZEND_WIN32)
+#include <intrin.h>
+#endif
+
 /* Only use this macro if you know for sure that all of the switches values
    are covered by its case statements */
 #if ZEND_DEBUG
index ee0e025c5df58ca9d5e00e2f155293c3db33217e..5adc9a9a118770ceaac719df153d412ba8f82e1e 100644 (file)
 
 #include "url_scanner_ex.h"
 
+#if defined(_WIN32) && defined(__clang__)
+#include <intrin.h>
+#endif
+
 extern zend_module_entry basic_functions_module;
 #define basic_functions_module_ptr &basic_functions_module