Skip to content

Commit 36857ab

Browse files
committed
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.
1 parent b1d2a89 commit 36857ab

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

Zend/zend_cpuinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static zend_cpu_info cpuinfo = {0};
3333
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
3434
__cpuid_count(func, subfunc, cpuinfo->eax, cpuinfo->ebx, cpuinfo->ecx, cpuinfo->edx);
3535
}
36-
#elif defined(ZEND_WIN32)
36+
#elif defined(ZEND_WIN32) && !defined(__clang__)
3737
# include <intrin.h>
3838
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
3939
int regs[4];

Zend/zend_portability.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
# include <alloca.h>
7171
#endif
7272

73-
#if defined(ZEND_WIN32)
73+
#if defined(ZEND_WIN32) && !defined(__clang__)
7474
#include <intrin.h>
7575
#endif
7676

ext/standard/basic_functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#include "url_scanner_ex.h"
3434

35-
#if defined(_WIN32) && defined(__clang__)
35+
#if defined(_WIN32) && !defined(__clang__)
3636
#include <intrin.h>
3737
#endif
3838

ext/standard/net.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
#endif
3333

3434
#ifdef PHP_WIN32
35+
# ifndef __clang__
3536
# include <intrin.h>
37+
# endif
3638
# include <winsock2.h>
3739
# include <ws2ipdef.h>
3840
# include <Ws2tcpip.h>

0 commit comments

Comments
 (0)