On Thu, Jul 9, 2015 at 1:44 AM, David Chisnall <thera...@freebsd.org> wrote: > 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).
Yes, but this case will fail for gcc 4.3 ~ 4.4 through 5.x if you use my recommended method... _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"