Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7954 Discussions

pragma selection based on compiler attribute

abhijeet_thatte
Beginner
237 Views
Hi,

My current project build can be done using 3 compilers namely ICL, VC10 and VC05. Every compilation needs its set of pragmas in header/source files. Is there any way to select them conditionaly based on what compiler I specify in my build.

I faintly remember that I have used compiler attributes to do this. But I also dont want compiler to give any error if it does not understand other compilers attributes.

In short I need something like this.

Header.h
//If ICL
#pragma icl_op1
#pragma icl_op2
//else if VC10
#pragma vc_10_op1
#pragma vc_10_op2
//else if VC05
#pragma vc_05_op1
#pragma vc_05_op2


Now I want to fill those "//If ICL or //else if VC10" comments.


0 Kudos
1 Reply
Om_S_Intel
Employee
237 Views

Intel compiler has predefined macros __ICL and __INTEL_COMPILER. You may use this in header to recognize Intel compiler and may use for appropriate processing.

0 Kudos
Reply