[Bug c++/68316] GCC C++ compiler cannot compile a program using RDESED intrinsics
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Nov 12 17:26:00 GMT 2015
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.
More information about the Gcc-bugs
mailing list