diff options
| author | Anatol Belski <ab@php.net> | 2018-08-01 16:19:54 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2018-08-01 16:19:54 +0200 |
| commit | 36857ab52b8cafc91650ccc55053abe6b517f092 (patch) | |
| tree | f898c008ab65b10bab0e08f9b9967e3d0263af02 | |
| parent | b1d2a89ac1a2880bfe6125738bad061317d63b7b (diff) | |
| download | php-git-36857ab52b8cafc91650ccc55053abe6b517f092.tar.gz | |
Fix clang compilation
By usage of -fmodules, all the intrinsic items are loaded automatically.
The headers included come however from Visual Studio, thus bringing some
conflicting declarations. On the other hand, -fmodules is needed to
mitigate linking issues with clang in VS compatibility mode.
| -rw-r--r-- | Zend/zend_cpuinfo.c | 2 | ||||
| -rw-r--r-- | Zend/zend_portability.h | 2 | ||||
| -rw-r--r-- | ext/standard/basic_functions.h | 2 | ||||
| -rw-r--r-- | ext/standard/net.c | 2 |
4 files changed, 5 insertions, 3 deletions
diff --git a/Zend/zend_cpuinfo.c b/Zend/zend_cpuinfo.c index 70e1dbf4fa..39519c4c16 100644 --- a/Zend/zend_cpuinfo.c +++ b/Zend/zend_cpuinfo.c @@ -33,7 +33,7 @@ static zend_cpu_info cpuinfo = {0}; static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) { __cpuid_count(func, subfunc, cpuinfo->eax, cpuinfo->ebx, cpuinfo->ecx, cpuinfo->edx); } -#elif defined(ZEND_WIN32) +#elif defined(ZEND_WIN32) && !defined(__clang__) # include <intrin.h> static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) { int regs[4]; diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 34d5a3d9b3..296ffe7436 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -70,7 +70,7 @@ # include <alloca.h> #endif -#if defined(ZEND_WIN32) +#if defined(ZEND_WIN32) && !defined(__clang__) #include <intrin.h> #endif diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index b8a917920f..c9b03e7a10 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -32,7 +32,7 @@ #include "url_scanner_ex.h" -#if defined(_WIN32) && defined(__clang__) +#if defined(_WIN32) && !defined(__clang__) #include <intrin.h> #endif diff --git a/ext/standard/net.c b/ext/standard/net.c index d1e78dcc7a..23806cabf8 100644 --- a/ext/standard/net.c +++ b/ext/standard/net.c @@ -32,7 +32,9 @@ #endif #ifdef PHP_WIN32 +# ifndef __clang__ # include <intrin.h> +# endif # include <winsock2.h> # include <ws2ipdef.h> # include <Ws2tcpip.h> |
