-
Notifications
You must be signed in to change notification settings - Fork 0
Preprocessor macros
A handful of macros are used in this project to selectively enable and disable code, depending on C++ version and platform. While this library conforms to the ISO C++98 standard, one of the compilers it was tested on does not; so some use of macros is needed to ensure smooth use of the library. This page will list them, whether they should be defined by the user, and what they do.
-
DP_CPPXX- WhereXXis a C++ standard number (11, 14, 17, 20, or 23). These are used to disable code which was removed (note: not deprecated) between C++98 and the stated C++ standard. These are inclusive, so#define DP_CPP17will selectively remove code which uses objects removed in C++11, C++14, and C++17. It is rare that you should need these, as use of future-removed features in this library will is rare, and this library should not be used in modern C++. -
DP_NO_ASSERT_MACRO- If defined before including thestatic_assertheader, theSTATIC_ASSERTmacro will not be defined. Note that theSTATIC_ASSERTmacro will not be transitively included by internal use of static assertions in this library, so this macro does not need to be used before including any other headers. -
DP_NO_INCLUDE_BYTE- Suppresses inclusion of thebyteheader from within a certain testing header. This is to allow the library to be tested on systems where the assertion thatsizeof(dp::byte) == 1does not hold. Note thatbyteis not included in any other headers so this is not needed in normal code. -
DP_BORLAND_USE_BORLAND_EXCEPTIONS- Used to allow library exceptions to inherit from the C++BuilderExceptionclass base on Borland compilers.
-
DP_BORLAND- Defined automatically if the user is using a Borland compiler from before the days where Embarcadero updated from C++98 (circa 2018). Used to selectively disable parts of the code which that compiler is unable to process. -
DP_CPPXX_OR_HIGHER- Used internally to selectively disable certain features which were removed in a particular C++ standard. Defined automatically when the user definesDP_CPPXXas a mechanism to allow inclusive changes (e.g. definingDP_CPP17also disables features removed in C++11 and C++14) -
STATIC_ASSERT- Defined automatically when including thestatic_assertheader, unless it is suppressed by there already being aSTATIC_ASSERTmacro defined, or the user definingDP_NO_ASSERT_MACRO. -
DP_BORLAND_EXCEPTIONS- Defined if the user enables Borland exceptions. Used internally to make this library's exception types inherit from Borland'sExceptiontype.