Mercurial > hg > nginx
comparison src/core/ngx_cpuinfo.c @ 9315:d286426eab1a
Support for Clang with "-fgnuc-version=0".
Previously, the code assumed that Clang pretends to be GCC and defines
the __GNUC__ macro, which might not be the case if the "-fgnuc-version=0"
flag is used. Fix is to explicitly check for __clang__ as well.
In practice, with this change ngx_cpuinfo() is now available on Linux
with "-fgnuc-version=0".
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 07 Aug 2024 03:58:30 +0300 |
parents | d620f497c50f |
children |
comparison
equal
deleted
inserted
replaced
9314:32a5186a2705 | 9315:d286426eab1a |
---|---|
7 | 7 |
8 #include <ngx_config.h> | 8 #include <ngx_config.h> |
9 #include <ngx_core.h> | 9 #include <ngx_core.h> |
10 | 10 |
11 | 11 |
12 #if (( __i386__ || __amd64__ ) && ( __GNUC__ || __INTEL_COMPILER )) | 12 #if (( __i386__ || __amd64__ ) \ |
13 && ( __GNUC__ || __clang__ || __INTEL_COMPILER )) | |
13 | 14 |
14 | 15 |
15 static ngx_inline void ngx_cpuid(uint32_t i, uint32_t *buf); | 16 static ngx_inline void ngx_cpuid(uint32_t i, uint32_t *buf); |
16 | 17 |
17 | 18 |