about "cpu.h: Fix compiler detection" patch

lvqcl <[email protected]>
Newsgroups gmane.comp.audio.compression.flac.devel
Message-ID <op.yvpzjnmmcba0by@userme-pc>
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__ || defined __clang__
   #if defined __clang__ && __has_attribute(__target__)
     // definitions for newer clang
   #elif !defined __clang__ && (__GNUC__ > 4 || (__GNUC__ == 4 &&  
__GNUC_MINOR__ >= 9))
     // definitions for newer GCC
   #else
     // definitions for older GCC and clang
   #endif
#endif



Now, it's basically:



#if defined __INTEL_COMPILER
   // definitions for ICC
#elif defined _MSC_VER
   // definitions for MSVC
#elif defined __GNUC__ && defined __clang__
   // definitions for clang
#endif



By the way, what's the problem with GCC 4.6?
According to <https://gcc.gnu.org/onlinedocs/cpp/If.html>:
"... and logical operations (&& and ||). The latter two obey the usual  
short-circuiting rules of standard C."

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.
_______________________________________________
flac-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/flac-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.