https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68316

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jeffrey Walton from comment #0)
> Adding a __has_include to guard <x86intrin.h> appears to open another can of
> worms:
> 
>     $ g++ -mrdseed rdseed.cxx -o rdseed.exe
>     rdseed.cxx:4:45: error: missing binary operator before token "("
>      #if defined(__has_include) && (__has_include(<x86intrin.h>))
>                                                  ^

This is because you're using GCC 4.8 which doesn't support __has_include, and
you're using it wrong. It should be:

#ifdef __has_include
# if __has_include(<x86intrin.h>)
#  include <x86intrin.h>
# endif
#endif

If you don't put the __has_include on the same line as the test for it then it
works correctly.

Reply via email to