On 9 Jul 2015, at 03:53, NGie Cooper <yaneurab...@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

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to