Date: Thu, 9 Jul 2015 02:19:19 -0700 From: NGie Cooper <yaneurabeya@gmail.com> To: David Chisnall <theraven@freebsd.org> Cc: Dimitry Andric <dim@freebsd.org>, Adrian Chadd <adrian.chadd@gmail.com>, Pedro Giffuni <pfg@freebsd.org>, Luigi Rizzo <luigi@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r285284 - head/lib/liblzma Message-ID: <CAGHfRMAX-twDC_-cGihbj6Q-vVCebrCKjw34Ub4g=iM_wFegWg@mail.gmail.com> In-Reply-To: <E1605BA4-DBE6-4F7B-BC5E-15E78671DF9B@FreeBSD.org> References: <201507081836.t68IacJu069563@repo.freebsd.org> <559D9172.9040305@FreeBSD.org> <CAJ-Vmo=m0Y%2BE0oi5ec5RzyziqObOj=fKY1K-8HzqK8x7D_TcKg@mail.gmail.com> <F5CD87E5-92B5-4E87-8DAF-18F4510CD113@FreeBSD.org> <CAGHfRMA%2BpybAf=snW_NdjyQ0Amnw%2Bz2aGEp8_F-eVKy9eqGRzg@mail.gmail.com> <E1605BA4-DBE6-4F7B-BC5E-15E78671DF9B@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 9, 2015 at 1:44 AM, David Chisnall <theraven@freebsd.org> wrote: > On 9 Jul 2015, at 03:53, NGie Cooper <yaneurabeya@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...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGHfRMAX-twDC_-cGihbj6Q-vVCebrCKjw34Ub4g=iM_wFegWg>