]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | (C) Copyright Edward Diener 2011-2015 | |
3 | Distributed under the Boost Software License, Version 1.0. | |
4 | (See accompanying file LICENSE_1_0.txt or copy at | |
5 | http://www.boost.org/LICENSE_1_0.txt). | |
6 | ] | |
7 | ||
8 | [section:vmd_vc Visual C++ define] | |
9 | ||
10 | Microsoft's Visual C++ compiler, abbreviated VC++, is a very popular compiler | |
11 | but does not implement the standard C++ preprocessor correctly in a number of respects. | |
12 | Because of this the programmer using the VMD needs to occasionally do things | |
13 | differently when VC++ is being used. These "quirks" of VC++ have been smoothed over | |
14 | as much as possible in the VMD library, but are mentioned in further topics and | |
15 | occasionally must be addressed by the programmer using VMD. | |
16 | ||
17 | The VMD has a macro that indicates when VC++ is the compiler being used. The | |
18 | macro is an object-like macro called BOOST_VMD_MSVC. It is set to 1 when VC++ | |
19 | is being used and set to 0 when VC++ is not being used. You can use this macro | |
20 | in your own macro code whenever you include a VMD header file to write code | |
21 | which may need special processing for VC++ as outlined in this documentation. | |
22 | Your macro processing may therefore occasional take the form of: | |
23 | ||
24 | #include <boost/vmd/some_header.hpp> | |
25 | ||
26 | #if BOOST_VMD_MSVC | |
27 | ||
28 | #define SOME_MACRO ... code for VC++ | |
29 | ||
30 | #else | |
31 | ||
32 | #define SOME_MACRO ... code for all other compilers | |
33 | ||
34 | #endif | |
35 | ||
36 | [endsect] |