|
11 | 11 | /// @parblock |
12 | 12 | /// |
13 | 13 | /// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8. |
14 | | -/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd. |
| 14 | +/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd. |
15 | 15 | /// |
16 | 16 | /// POV-Ray is free software: you can redistribute it and/or modify |
17 | 17 | /// it under the terms of the GNU Affero General Public License as |
|
93 | 93 | #pragma warning(disable : 4305) /* truncation from 'type1' to 'type2' (mostly double to float) */ |
94 | 94 | #pragma warning(disable : 4244) /* possible loss of data (converting ints to shorts) */ |
95 | 95 |
|
96 | | - #if _MSC_VER >= 1400 && _MSC_VER < 1500 && !defined (_WIN64) |
97 | | - // MS Visual C++ 2005 (aka 8.0), compiling for 32 bit target |
98 | | - #define POV_COMPILER_VER "msvc8" |
99 | | - #define METADATA_COMPILER_STRING "msvc 8" |
100 | | - #define NEED_INVHYP |
101 | | - #define POV_CPP11_SUPPORTED 0 |
102 | | - #define POV_CPP14_SUPPORTED 0 |
103 | | - #elif _MSC_VER >= 1400 && _MSC_VER < 1500 && defined (_WIN64) |
104 | | - // MS Visual C++ 2005 (aka 8.0), compiling for 64 bit target |
105 | | - #define POV_COMPILER_VER "msvc8" |
106 | | - #define METADATA_COMPILER_STRING "msvc 8" |
107 | | - inline const int& max(const int& _X, const int& _Y) {return (_X < _Y ? _Y : _X); } |
108 | | - inline const int& min(const int& _X, const int& _Y) {return (_Y < _X ? _Y : _X); } |
109 | | - inline const unsigned int& max(const unsigned int& _X, const unsigned int& _Y) {return (_X < _Y ? _Y : _X); } |
110 | | - inline const unsigned int& min(const unsigned int& _X, const unsigned int& _Y) {return (_Y < _X ? _Y : _X); } |
111 | | - inline const long& max(const long& _X, const long& _Y) {return (_X < _Y ? _Y : _X); } |
112 | | - inline const long& min(const long& _X, const long& _Y) {return (_Y < _X ? _Y : _X); } |
113 | | - inline const unsigned long& max(const unsigned long& _X, const unsigned long& _Y) {return (_X < _Y ? _Y : _X); } |
114 | | - inline const unsigned long& min(const unsigned long& _X, const unsigned long& _Y) {return (_Y < _X ? _Y : _X); } |
115 | | - #define NEED_INVHYP |
116 | | - #define POV_CPP11_SUPPORTED 0 |
117 | | - #define POV_CPP14_SUPPORTED 0 |
118 | | - #elif _MSC_VER >= 1500 && _MSC_VER < 1600 |
119 | | - // MS Visual C++ 2008 (aka 9.0) |
120 | | - #define POV_COMPILER_VER "msvc9" |
121 | | - #define METADATA_COMPILER_STRING "msvc 9" |
122 | | - #define NEED_INVHYP |
123 | | - #define POV_CPP11_SUPPORTED 0 |
124 | | - #define POV_CPP14_SUPPORTED 0 |
125 | | - #elif _MSC_VER >= 1600 && _MSC_VER < 1700 |
126 | | - // MS Visual C++ 2010 (aka 10.0) |
127 | | - #define POV_COMPILER_VER "msvc10" |
128 | | - #define METADATA_COMPILER_STRING "msvc 10" |
129 | | - // msvc10 defines std::hash<> as a class, while boost's flyweight_fwd.hpp may forward-declare it as a struct; |
130 | | - // this is valid according to the C++ standard, but causes msvc10 to issue warnings. |
131 | | - #pragma warning(disable : 4099) |
132 | | - #define NEED_INVHYP |
133 | | - #define POV_CPP11_SUPPORTED 0 |
134 | | - #define POV_CPP14_SUPPORTED 0 |
135 | | - #elif _MSC_VER >= 1700 && _MSC_VER < 1800 |
136 | | - // MS Visual C++ 2012 (aka 11.0) |
137 | | - #define POV_COMPILER_VER "msvc11" |
138 | | - #define METADATA_COMPILER_STRING "msvc 11" |
139 | | - #error "Please update syspovconfig_msvc.h to include this version of MSVC" |
140 | | - // The following settings are just guesswork, and have never been tested: |
141 | | - #define NEED_INVHYP |
142 | | - #define POV_CPP11_SUPPORTED 0 |
143 | | - #define POV_CPP14_SUPPORTED 0 |
144 | | - #elif _MSC_VER >= 1800 && _MSC_VER < 1900 |
145 | | - // MS Visual C++ 2013 (aka 12.0) |
146 | | - #define POV_COMPILER_VER "msvc12" |
147 | | - #define METADATA_COMPILER_STRING "msvc 12" |
148 | | - #error "Please update syspovconfig_msvc.h to include this version of MSVC" |
149 | | - // The following settings are just guesswork, and have never been tested: |
150 | | - #define POV_CPP11_SUPPORTED 0 |
151 | | - #define POV_CPP14_SUPPORTED 0 |
152 | | - // NB: The Microsoft Visual Studio developers seem to have skipped internal version number 13 entirely. |
153 | | - #elif _MSC_VER >= 1900 && _MSC_VER < 2000 |
| 96 | + #if _MSC_VER < 1900 |
| 97 | + // Visual C++ 2013 and earlier do not comply with C++11, |
| 98 | + // which as of v3.8.0 is a prerequisite for compiling POV-Ray. |
| 99 | + #error "This software no longer supports your version of MS Visual C++" |
| 100 | + #elif _MSC_VER >= 1900 && _MSC_VER < 1910 |
154 | 101 | // MS Visual C++ 2015 (aka 14.0) |
155 | 102 | #define POV_COMPILER_VER "msvc14" |
156 | | - #define METADATA_COMPILER_STRING "msvc 14" |
| 103 | + #define METADATA_COMPILER_STRING "msvc 14.0" |
| 104 | + // Visual C++ 2015 defines `__cplusplus` as `199711L` (C++98), |
| 105 | + // but supports all the C++11 features we need |
157 | 106 | #define POV_CPP11_SUPPORTED 1 |
158 | | - #define POV_CPP14_SUPPORTED 1 |
159 | 107 | #ifndef DEBUG |
160 | 108 | // Suppress erroneous warning about `string` having different alignment in base and parser. |
161 | 109 | #pragma warning(disable : 4742) // 'var' has different alignment in 'file1' and 'file2': number and number |
162 | 110 | #endif |
| 111 | + #elif _MSC_VER >= 1910 && _MSC_VER < 1920 |
| 112 | + // MS Visual C++ 2017 (aka 14.1x) |
| 113 | + #define POV_COMPILER_VER "msvc141" |
| 114 | + #define METADATA_COMPILER_STRING "msvc 14.1x" |
| 115 | + // Visual C++ 2017 15.6 (and earlier) defines `__cplusplus` as `199711L` (C++98), |
| 116 | + // but supports all the C++11 features we need (and also pretty much all of C++14) |
| 117 | + #define POV_CPP11_SUPPORTED 1 |
| 118 | + #define POV_CPP14_SUPPORTED 1 |
| 119 | + // TODO - This compiler version has been tested, but no effort has been made yet |
| 120 | + // to iron out any inconveniences such as unwarranted warnings or the like. |
| 121 | + #elif _MSC_VER >= 1920 && _MSC_VER < 1930 |
| 122 | + // MS Visual C++ 2019 (aka 14.2x) |
| 123 | + #define POV_COMPILER_VER "msvc142" |
| 124 | + #define METADATA_COMPILER_STRING "msvc 14.2x" |
| 125 | + // (no need to set `POV_*_SUPPORTED for VS 2019 and later, we can probe `__cplusplus`) |
| 126 | + // TODO - This compiler version has been tested, but no effort has been made yet |
| 127 | + // to iron out any inconveniences such as unwarranted warnings or the like. |
163 | 128 | #else |
164 | | - #error "Please update syspovconfig_msvc.h to include this version of MSVC" |
| 129 | + // Unrecognized version of MS Visual C++ |
| 130 | + #error("Your version of MS Visual C++ is still unknown to us. Proceed at your own risk.") |
| 131 | + #define POV_COMPILER_VER "msvc" |
| 132 | + #define METADATA_COMPILER_STRING "msvc" |
165 | 133 | #endif |
166 | 134 | #define COMPILER_NAME "Microsoft Visual C++" |
167 | 135 | #define COMPILER_VERSION _MSC_VER |
|
0 commit comments