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

When is _MSC_VER define in 2013 version

eldiener
New Contributor I
1,254 Views

When is _MSC_VER defined in 2013 version of the C++ compiler ?

0 Kudos
1 Solution
Judith_W_Intel
Employee
1,254 Views

 

_MSC_VER is always defined whenever you are using our Windows based (icl) compiler. It is set to whatever version of the Microsoft compiler is in your PATH.

View solution in original post

0 Kudos
9 Replies
Judith_W_Intel
Employee
1,255 Views

 

_MSC_VER is always defined whenever you are using our Windows based (icl) compiler. It is set to whatever version of the Microsoft compiler is in your PATH.

0 Kudos
SergeyKostrov
Valued Contributor II
1,254 Views
If you need a complete list of _MSC_VER values for different MS Visual C++ compilers and Visual Studios take a look at MSDN. If you're unable to find let me know and I will check some headers I have.
0 Kudos
Bernard
Valued Contributor I
1,254 Views

@Sergey

How are those header files named?

0 Kudos
TimP
Honored Contributor III
1,254 Views

As far as I can see, MSC_VER is not defined in the Microsoft headers, although many of them check the value.  The presence of a definition is often used to determine that Microsoft CL is present.

0 Kudos
Judith_W_Intel
Employee
1,254 Views

 

Tim is correct. _MSC_VER is predefined by the compiler, not in any header. You can see this with this simple program where cl is pointing at MSVC++ 2008 (microsoft_version 1500):

!% cat t.cpp

_MSC_VER
!% icl -E t.cpp
Intel(R) C++ Compiler XE for applications running on IA-32, Version Mainline Bet
a Build x
Built Nov 20 2013 11:49:27 by jward4 on JWARD4-DESK in D:/workspaces/cfe/dev
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.

t.cpp
#line 1 "t.cpp"

1500
!%

 

 

 

0 Kudos
SergeyKostrov
Valued Contributor II
1,254 Views
>>@Sergey >> >>How are those header files named? Sorry, I didn't understand what do you mean...
0 Kudos
Bernard
Valued Contributor I
1,254 Views

Sorry for badly formulated question.

I wanted to ask what is the name of those header files which were mentioned in your post.

0 Kudos
SergeyKostrov
Valued Contributor II
1,254 Views
>>...I wanted to ask what is the name of those header files which were mentioned in your post. This is an internal header file and in another words it is a proprietary. However, _MSC_VER version codes are Not proprietary and available to everybody ( Microsoft shares it freely ).
0 Kudos
Bernard
Valued Contributor I
1,254 Views

I have found the needed info on MSDN.

0 Kudos
Reply