1
0
mirror of https://github.com/leethomason/tinyxml2.git synced 2026-07-21 19:23:00 +04:00

Mark project constants depending on C++ version (#1056)

This commit is contained in:
Miko
2026-05-23 19:19:24 -04:00
committed by GitHub
parent beb16fbca0
commit 63428c8852
+12 -4
View File
@@ -85,12 +85,20 @@ distribution.
#endif #endif
#endif #endif
#if defined(__cplusplus) && __cplusplus >= 201703L
#define TINYXML2_CONSTANT inline constexpr
#elif defined(__cplusplus) && __cplusplus >= 201103L
#define TINYXML2_CONSTANT static constexpr
#else
#define TINYXML2_CONSTANT static const
#endif
/* Versioning, past 1.0.14: /* Versioning, past 1.0.14:
http://semver.org/ http://semver.org/
*/ */
static const int TIXML2_MAJOR_VERSION = 11; TINYXML2_CONSTANT int TIXML2_MAJOR_VERSION = 11;
static const int TIXML2_MINOR_VERSION = 0; TINYXML2_CONSTANT int TIXML2_MINOR_VERSION = 0;
static const int TIXML2_PATCH_VERSION = 0; TINYXML2_CONSTANT int TIXML2_PATCH_VERSION = 0;
#define TINYXML2_MAJOR_VERSION 11 #define TINYXML2_MAJOR_VERSION 11
#define TINYXML2_MINOR_VERSION 0 #define TINYXML2_MINOR_VERSION 0
@@ -101,7 +109,7 @@ static const int TIXML2_PATCH_VERSION = 0;
// system, and the capacity of the stack. On the other hand, it's a trivial // system, and the capacity of the stack. On the other hand, it's a trivial
// attack that can result from ill, malicious, or even correctly formed XML, // attack that can result from ill, malicious, or even correctly formed XML,
// so there needs to be a limit in place. // so there needs to be a limit in place.
static const int TINYXML2_MAX_ELEMENT_DEPTH = 500; TINYXML2_CONSTANT int TINYXML2_MAX_ELEMENT_DEPTH = 500;
namespace tinyxml2 namespace tinyxml2
{ {