Community
cancel
Showing results for 
Search instead for 
Did you mean: 
eldiener
New Contributor I
442 Views

When is _MSC_VER define in 2013 version

Jump to solution

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

0 Kudos
1 Solution
Judith_W_Intel
Employee
442 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

9 Replies
Judith_W_Intel
Employee
443 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

SergeyKostrov
Valued Contributor II
442 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.
Bernard
Black Belt
442 Views

@Sergey

How are those header files named?

TimP
Black Belt
442 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.

Judith_W_Intel
Employee
442 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
!%

 

 

 

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

Sorry for badly formulated question.

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

SergeyKostrov
Valued Contributor II
442 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 ).
Bernard
Black Belt
442 Views

I have found the needed info on MSDN.

Reply