#define MYPLATFORM(name) MYDEF_##name()

#define MYPLATFORM(name) MYDEF_##name()

This code doesn't compiled by Intel's C++ Compiler 11:#define MYPLATFORM(name) MYDEF_##name()#if !MYPLATFORM(x86_MMXEXT) && !MYPLATFORM(x86_SSE) ...Compiler will generate an error:error : function call is not allowed in a constant expression

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The actual problem does not seem to be the compiler, but the pre-processor.
It should depend on the definition of MYDEF_x86_MMXEXT and MYDEF_x86_SSE.
If they are macros that do not expect a parameter, eg:

#define MYDEF_x86_MMXEXT() x

It should work and version 11.1 of icpc compiles the code.

Leave a Comment

Please sign in to add a comment. Not a member? Join today