Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7667 Discussions

When is _MSC_VER define in 2013 version

eldiener
New Contributor I
701 Views

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

0 Kudos
1 Solution
Judith_W_Intel
Employee
701 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
702 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.

SergeyKostrov
Valued Contributor II
701 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
701 Views

@Sergey

How are those header files named?

TimP
Black Belt
701 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
701 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
701 Views
>>@Sergey >> >>How are those header files named? Sorry, I didn't understand what do you mean...
Bernard
Black Belt
701 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
701 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
701 Views

I have found the needed info on MSDN.

Reply