Community
cancel
Showing results for 
Search instead for 
Did you mean: 
abhijeet_thatte
Beginner
64 Views

pragma selection based on compiler attribute

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
64 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.

Reply