Please comment on whetherthere is supposed to be a way forthe Intel compiler toexposeitsmacros to the IDE for such purposes.Any references torelevant documentation would be appreciated.
Please take a look at a topic'Predefined Macros' in MSDN ( C/C++ Preprocessor Reference ).
Mictosoft clearly states that the compiler recognizes two types of PredefinedMacros, that is, ANSI C and Microsoft specific.
Both types could be alsocalled as Builtin Macros.
_MSC_VER macro isthe macroof the 2nd type. __INTEL_COMPILER macrois Intel specific and it will neverbe
included into any list supported by the MS C/C++ compiler.
I'd like to provide an example on how a support for different C/C++ compilers could be done for a project.
Instead of usinginternal C/C++compiler macros, like__INTEL_COMPILER or __ICC,a set of project specific macros
is used ( exception _MSC_VER macro ). Please note, that in that case IntelliSense recognizes all project specificmacros.
[cpp]/////////////////////////////////////////////////////////////////////////////// // Supported Integrated Development Environments ( IDEs ) and C++ Compilers ... #undef _CPPCOMPILER_VER #undef _CPPCOMPILER_VER_BASE #define _CPPCOMPILER_VER_BASE ( 2000 ) #if defined ( _WIN32_MGW ) #define _GCC_VER ( _CPPCOMPILER_VER_BASE + 0342 ) #endif #if defined ( _WIN32_BCC ) #define _BCC_VER ( _CPPCOMPILER_VER_BASE + 0551 ) #endif #if defined ( _COS16_TCC ) #define _TCC_VER ( _CPPCOMPILER_VER_BASE + 0300 ) #endif #if defined ( _WIN32_ICC ) #define _ICC_VER ( _CPPCOMPILER_VER_BASE + 10000 ) #endif /////////////////////////////////////////////////////////////////////////////// #if defined ( _WIN32_MSC ) #define _CPPCOMPILER_VER ( _MSC_VER ) #endif #if defined ( _WIN32CE_MSC ) #define _CPPCOMPILER_VER ( _MSC_VER ) #endif #if defined ( _WIN32_MGW ) #define _CPPCOMPILER_VER ( _GCC_VER ) #endif #if defined ( _WIN32_BCC ) #define _CPPCOMPILER_VER ( _BCC_VER ) #endif #if defined ( _COS16_TCC ) #define _CPPCOMPILER_VER ( _TCC_VER ) #endif #if defined ( _WIN32_ICC ) #define _CPPCOMPILER_VER ( _ICC_VER ) #endif ... [/cpp]
Perhaps this is just dreaming, but it would be great if there could be an agreed techniqueby which a compiler couldpublish (in a file) or export(through an API) its compile time environment.This waythe IDE could utilize this information tohavea more legitimate awareness forbenefit of theuser. Itis silly foran IDE to provide for hooksto third party build tools, and then the IDE's user interface (Intellisense) marches to a totally different drum.
Maybe even better would be if the compiler could export relevant portions of its functionality so that the IDE could just call into the currentlyconfigured compilerto obtaincode awareness, instead of implementing its owndistinct compiler.
That is possible because Microsoft's software is full of undocumented features. Since both companies are making money by selling
software development tools I won't be surprized if Microsoft simply didn't release some technical details to Intel, even if there is a cooperation
between these two companies.
I confirm that __INTEL_COMPILER macro is not visible withVisual Studios 2005, 2008 and 2010.
However, a simple workaround could be used:
#define _RT_INTEL_COMPILER __INTEL_COMPILER
The_RT_INTEL_COMPILER macrois visible to IntelliSense. It isverified with Visual Studio 2005 and Intel C++ Composer XE 2011.