- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
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:
[cpp]#define MYDEF_x86_MMXEXT() x[/cpp]It should work and version 11.1 of icpc compiles the code.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page