svn commit: r285284 - head/lib/liblzma

David Chisnall theraven at FreeBSD.org
Thu Jul 9 08:43:55 UTC 2015


On 9 Jul 2015, at 03:53, NGie Cooper <yaneurabeya at gmail.com> wrote:
> 
> $ cat ~/has_immintrin.c
> #include <sys/cdefs.h>
> 
> #if __has_include(<immintrin.h>)
> #error "I have immintrin.h"
> #else
> #error "I don't have immintrin.h"
> #endif
> $ clang -c ~/has_immintrin.c
> /home/ngie/has_immintrin.c:4:2: error: "I have immintrin.h"
> #error "I have immintrin.h"
> ^
> 1 error generated.
> $ gcc -c ~/has_immintrin.c
> /home/ngie/has_immintrin.c:6:2: error: #error "I don't have immintrin.h"
> 
> Sadly this macro wasn't added until gcc 5.x:
> https://gcc.gnu.org/gcc-5/changes.html

cdefs.h defines __has_include(x) to 0 if the compiler does not provide __has_include(), so this will also work with gcc in base (always claiming not to have immintrin.h).

David



More information about the svn-src-head mailing list