Skip to content

Commit 37b99bd

Browse files
committed
Miscellaneous hosekeeping.
- Update `windows/povconfig/syspovconfig_msvc.h` to detect modern versions of Visual Studio. Also, discard detailed detection of earlier versions we no longer support anyway. - Move `POV_BOMB_ON_ERROR` compile-time config setting from core to base where it belongs. - Clean up whitespace in some files. - Added a few comments.
1 parent 110df4f commit 37b99bd

File tree

8 files changed

+59
-87
lines changed

8 files changed

+59
-87
lines changed

source/base/configbase.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// @parblock
1111
///
1212
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
13-
/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
13+
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
1414
///
1515
/// POV-Ray is free software: you can redistribute it and/or modify
1616
/// it under the terms of the GNU Affero General Public License as
@@ -903,6 +903,24 @@
903903
#define POV_STRING_DEBUG POV_DEBUG
904904
#endif
905905

906+
/// @def POV_BOMB_ON_ERROR
907+
/// Fail hard on all errors, allowing a debugger to kick in.
908+
///
909+
/// Define as non-zero integer to enable, or zero to disable.
910+
///
911+
/// If left undefined by system-specific configurations, this setting defaults to `0`.
912+
///
913+
/// @attention
914+
/// This setting is _strictly_ for debugging purposes only. It should _never ever_ be enabled
915+
/// in _any_ builds released to end users, be it release builds or otherwise!
916+
///
917+
/// @note
918+
/// At present, this is not yet supported by all error conditions.
919+
///
920+
#ifndef POV_BOMB_ON_ERROR
921+
#define POV_BOMB_ON_ERROR 0
922+
#endif
923+
906924
/// @}
907925
///
908926
//******************************************************************************

source/core/configcore.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -290,24 +290,6 @@
290290
///
291291
/// @{
292292

293-
/// @def POV_BOMB_ON_ERROR
294-
/// Fail hard on all errors, allowing a debugger to kick in.
295-
///
296-
/// Define as non-zero integer to enable, or zero to disable.
297-
///
298-
/// If left undefined by system-specific configurations, this setting defaults to `0`.
299-
///
300-
/// @attention
301-
/// This setting is _strictly_ for debugging purposes only, and should _never ever_ be enabled
302-
/// in a release build!
303-
///
304-
/// @note
305-
/// At present, this is not yet supported by all error conditions.
306-
///
307-
#ifndef POV_BOMB_ON_ERROR
308-
#define POV_BOMB_ON_ERROR 0
309-
#endif
310-
311293
/// @def POV_CORE_DEBUG
312294
/// Default setting for enabling or disabling @ref PovCore debugging aids.
313295
///

unix/config/ax_check_libjpeg.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ AC_DEFUN([AX_CHECK_LIBJPEG],
4040
[jpeglib.h],
4141
[
4242
# check library version, update LIBS
43-
if test x"$1" != x"$ax_check_libjpeg_version_num"; then
43+
if test x"$1" != x"$ax_check_libjpeg_version_num"; then
4444
AC_MSG_CHECKING([for libjpeg version >= $1 ($ax_check_libjpeg_version_num)])
4545
else
4646
AC_MSG_CHECKING([for libjpeg version >= $1])

unix/config/ax_check_openexr.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ AC_DEFUN([AX_CHECK_OPENEXR],
5050
# FIXME: workaround for versions >= 1.4.0
5151
AX_COMPARE_VERSION([$ax_check_openexr_version], [ge], [1.4],
5252
[LIBS="$ax_check_openexr_libs -lIlmThread $LIBS"],
53-
[LIBS="$ax_check_openexr_libs $LIBS"]
53+
[LIBS="$ax_check_openexr_libs $LIBS"]
5454
)
5555
5656
# check include file

windows/povconfig/syspovconfig.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/// @parblock
1414
///
1515
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
16-
/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
16+
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
1717
///
1818
/// POV-Ray is free software: you can redistribute it and/or modify
1919
/// it under the terms of the GNU Affero General Public License as
@@ -117,6 +117,9 @@
117117

118118
namespace povwin
119119
{
120+
// Debugging aids.
121+
// These are not normally called from the POV-Ray code, but are kept around as useful helpers
122+
// during debug sessions.
120123
void WIN_Debug_Log(unsigned int from, const char *msg) ;
121124
void WIN32_DEBUG_OUTPUT(const char *format,...) ;
122125
void WIN32_DEBUG_FILE_OUTPUT(const char *format,...) ;

windows/povconfig/syspovconfig_msvc.h

Lines changed: 30 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// @parblock
1212
///
1313
/// 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.
1515
///
1616
/// POV-Ray is free software: you can redistribute it and/or modify
1717
/// it under the terms of the GNU Affero General Public License as
@@ -93,75 +93,43 @@
9393
#pragma warning(disable : 4305) /* truncation from 'type1' to 'type2' (mostly double to float) */
9494
#pragma warning(disable : 4244) /* possible loss of data (converting ints to shorts) */
9595

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
154101
// MS Visual C++ 2015 (aka 14.0)
155102
#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
157106
#define POV_CPP11_SUPPORTED 1
158-
#define POV_CPP14_SUPPORTED 1
159107
#ifndef DEBUG
160108
// Suppress erroneous warning about `string` having different alignment in base and parser.
161109
#pragma warning(disable : 4742) // 'var' has different alignment in 'file1' and 'file2': number and number
162110
#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.
163128
#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"
165133
#endif
166134
#define COMPILER_NAME "Microsoft Visual C++"
167135
#define COMPILER_VERSION _MSC_VER

windows/pvedit.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// @parblock
1111
///
1212
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
13-
/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
13+
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
1414
///
1515
/// POV-Ray is free software: you can redistribute it and/or modify
1616
/// it under the terms of the GNU Affero General Public License as
@@ -259,6 +259,7 @@ bool LoadEditorDLL (char *path, bool errorOK)
259259
return (true) ;
260260
}
261261

262+
// TODO FIXME - This is almost identical to Parser::Get_Reserved_Words() in parser/parser_tokenizer.cpp.
262263
char *Get_Reserved_Words (const char *additional_words)
263264
{
264265
int length = 0 ;

windows/pvengine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// @parblock
1111
///
1212
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
13-
/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
13+
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
1414
///
1515
/// POV-Ray is free software: you can redistribute it and/or modify
1616
/// it under the terms of the GNU Affero General Public License as
@@ -375,7 +375,7 @@ CRITICAL_SECTION critical_section ;
375375
// key is the name of an included file (all lower case).
376376
// content is the name of the most recent rendered file that caused it to be included.
377377
map<std::string, std::string> IncludeToSourceMap;
378-
map<std::string, bool> IncludeAlternateDecisionMap;
378+
map<std::string, bool> IncludeAlternateDecisionMap;
379379

380380
char queued_files [MAX_QUEUE] [_MAX_PATH] ;
381381
char dir [_MAX_PATH] ;

0 commit comments

Comments
 (0)