Re: [flac-dev] about "cpu.h: Fix compiler detection" patch

2017-02-17 Thread Erik de Castro Lopo
lvqcl wrote: > Maybe it's simpler to add > > #ifndef __has_attribute > #define __has_attribute(x) 0 > #endif Good suggestion. Seems to work. Current PR is here: https://github.com/xiph/flac/pull/30 Erik -- -- Erik de Cast

Re: [flac-dev] about "cpu.h: Fix compiler detection" patch

2017-02-16 Thread lvqcl
Erik de Castro Lopo wrote: the bug *before* the logic is evaluated. My current solution in the above PR is to avoid `__has_attribute` and use this: #elif defined __clang__ && (__clang_major__ > 3 || \ (__clang_major__ == 3 && __clang_minor__ >= 6)) /* clang */ which I have tested

Re: [flac-dev] about "cpu.h: Fix compiler detection" patch

2017-02-16 Thread Erik de Castro Lopo
lvqcl wrote: > So I thought that the directive > > #if defined __clang__ && __has_attribute(__target__) > > is ok for GCC because "defined __clang__" is false and > preprocessor shouldn't try to parse "__has_attribute(...)" part. It seems this is actually a pre-processor parsing bug. It hit

Re: [flac-dev] about "cpu.h: Fix compiler detection" patch

2017-02-15 Thread Erik de Castro Lopo
lvqcl wrote: > After this patch, all FLAC__SSEN_SUPPORTED variables are > undefined for GCC, so intrinsic versions of functions are > not compiled into libFLAC. Sigh! The C preprocessor is by far the very worst feature of the C langauge. Its hard to read, hard to debug, hard to verify and just

[flac-dev] about "cpu.h: Fix compiler detection" patch

2017-02-15 Thread lvqcl
After this patch, all FLAC__SSEN_SUPPORTED variables are undefined for GCC, so intrinsic versions of functions are not compiled into libFLAC. Previously, the code was: #if defined __INTEL_COMPILER // definitions for ICC #elif defined _MSC_VER // definitions for MSVC #elif defined __GNUC__ ||