From owner-svn-src-head@freebsd.org Thu Jul 9 09:19:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFEA499617B; Thu, 9 Jul 2015 09:19:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7BEE1897; Thu, 9 Jul 2015 09:19:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qgeg89 with SMTP id g89so112508135qge.3; Thu, 09 Jul 2015 02:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=IQiUk0hhrkH/jRDDrdJs/ZLEqi0Hwwh2nCsdm5WLlhw=; b=XSOYjFbWLPVgkydolZwrrz5UQx0vNjjPmieEo2n+cfDaOclce+z/JVyVHasvnXa/tv 3etWQLMrQX6/aov9mlXFOH72NbNC2EgZ0YLFDewIUP8jQAcCVFl/o/half/0a+6XmEXV 9XOEvLgdqf57a8bpYSHuz/5dWKYsIrU7a5C5+bwS1DB8egaacsT4I0Nds7NXjJSmg8iI A/WQki7WU6FertJThZPJNsEX9Jb83d8D1nR1BObZx9QzW/E9WkgAkGGuXZnHWB/KBKLQ 0jk9J+DbIggz2Nl7srTbdm/1LPzm18NOKzNE/GkGdW4k04FNbLgpG8P3c7FaA1YMD3uY h6rw== MIME-Version: 1.0 X-Received: by 10.55.53.193 with SMTP id c184mr22055217qka.62.1436433559731; Thu, 09 Jul 2015 02:19:19 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Thu, 9 Jul 2015 02:19:19 -0700 (PDT) In-Reply-To: References: <201507081836.t68IacJu069563@repo.freebsd.org> <559D9172.9040305@FreeBSD.org> Date: Thu, 9 Jul 2015 02:19:19 -0700 Message-ID: Subject: Re: svn commit: r285284 - head/lib/liblzma From: NGie Cooper To: David Chisnall Cc: Dimitry Andric , Adrian Chadd , Pedro Giffuni , Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2015 09:19:21 -0000 On Thu, Jul 9, 2015 at 1:44 AM, David Chisnall wrote: > On 9 Jul 2015, at 03:53, NGie Cooper wrote: >> >> $ cat ~/has_immintrin.c >> #include >> >> #if __has_include() >> #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...