Compiler Macros Preprocessor macros to detect compiler and platform features. More...
Macros | |
| #define | SC_ASSERT_RELEASE(e) |
Assert expression e to be true. | |
| #define | SC_ASSERT_DEBUG(e) |
Assert expression e to be true. | |
| #define | SC_TRUST_RESULT(expression) |
| Asserts that the given result is valid. | |
| #define | SC_COMPILER_CLANG 0 |
| Flag indicating Clang compiler. | |
| #define | SC_COMPILER_GCC 1 |
| Flag indicating GCC compiler. | |
| #define | SC_COMPILER_MSVC 0 |
| Flag indicating MSVC compiler. | |
| #define | SC_COMPILER_CLANG_CL 0 |
| Flag indicating non-Clang-CL (MSVC) compiler. | |
| #define | SC_COMPILER_FORCE_INLINE __attribute__((always_inline)) inline |
| Macro for forcing inline functions. | |
| #define | SC_COMPILER_EXTERN |
| Define compiler-specific export macros for DLL visibility. | |
| #define | SC_COMPILER_EXPORT __attribute__((visibility("default"))) |
| #define | SC_COMPILER_ASAN 0 |
| Flag indicating the absence of Address Sanitizer (ASAN). | |
| #define | SC_COMPILER_WARNING_POP _Pragma("warning(pop)") |
| Pops warning from inside a macro. | |
| #define | SC_COMPILER_OFFSETOF(Class, Field) |
| Returns offset of Class::Field in bytes. | |
| #define | SC_COMPILER_FIELD_OFFSET(Class, Field, Value) |
| #define | SC_COMPILER_WARNING_PUSH_OFFSETOF |
| Disables invalid-offsetof gcc and clang warning. | |
| #define | SC_COMPILER_UNUSED(param) |
Silence an unused variable or unused parameter warning. | |
| #define | SC_COMPILER_WARNING_PUSH_UNUSED_RESULT _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wunused-result\"") |
Disables unused-result warning (due to ignoring a return value marked as [[nodiscard]]) | |
| #define | SC_LANGUAGE_CPP_VERSION __cplusplus |
SC_LANGUAGE_FORCE_STANDARD_CPP == 14, 17 or 20 to force a specific C++ standard version. | |
| #define | SC_LANGUAGE_CPP_AT_LEAST_20 0 |
| True (1) if C++ standard is <= C++ 20. | |
| #define | SC_LANGUAGE_CPP_AT_LEAST_17 0 |
| True (1) if C++ standard is <= C++ 17. | |
| #define | SC_LANGUAGE_CPP_AT_LEAST_14 0 |
| True (1) if C++ standard is <= C++ 14. | |
| #define | SC_LANGUAGE_LIKELY |
| #define | SC_LANGUAGE_UNLIKELY |
| #define | SC_LANGUAGE_IF_CONSTEXPR |
| #define | SC_LANGUAGE_EXCEPTIONS 0 |
| #define | SC_LANGUAGE_LIFETIME_BOUND |
| #define | SC_CONFIGURATION_DEBUG 0 |
| True (1) if debug configuration is active (_DEBUG==1 or DEBUG==1) | |
| #define | SC_CONFIGURATION_RELEASE 1 |
| True (1) if release configuration is active (!(_DEBUG==1 or DEBUG==1)) | |
Compiler Macros Preprocessor macros to detect compiler and platform features.
| #define SC_ASSERT_DEBUG | ( | e | ) |
#include <Assert.h>
Assert expression e to be true.
If Failed, prints the failed assertion with backtrace, breaks debugger and exits (-1). Only active under SC_CONFIGURATION_DEBUG configuration, and defined to empty otherwise
| #define SC_ASSERT_RELEASE | ( | e | ) |
#include <Assert.h>
Assert expression e to be true.
If Failed, prints the failed assertion with backtrace, breaks debugger and exits (-1)
| #define SC_COMPILER_ASAN 0 |
#include <Compiler.h>
Flag indicating the absence of Address Sanitizer (ASAN).
| #define SC_COMPILER_CLANG 0 |
#include <Compiler.h>
Flag indicating Clang compiler.
| #define SC_COMPILER_CLANG_CL 0 |
#include <Compiler.h>
Flag indicating non-Clang-CL (MSVC) compiler.
| #define SC_COMPILER_EXTERN |
#include <Compiler.h>
Define compiler-specific export macros for DLL visibility.
| #define SC_COMPILER_FIELD_OFFSET | ( | Class, | |
| Field, | |||
| Value ) |
#include <Compiler.h>
| #define SC_COMPILER_FORCE_INLINE __attribute__((always_inline)) inline |
#include <Compiler.h>
Macro for forcing inline functions.
| #define SC_COMPILER_GCC 1 |
#include <Compiler.h>
Flag indicating GCC compiler.
| #define SC_COMPILER_MSVC 0 |
#include <Compiler.h>
Flag indicating MSVC compiler.
| #define SC_COMPILER_OFFSETOF | ( | Class, | |
| Field ) |
#include <Compiler.h>
Returns offset of Class::Field in bytes.
| #define SC_COMPILER_UNUSED | ( | param | ) |
#include <Compiler.h>
Silence an unused variable or unused parameter warning.
| #define SC_COMPILER_WARNING_POP _Pragma("warning(pop)") |
#include <Compiler.h>
Pops warning from inside a macro.
| #define SC_COMPILER_WARNING_PUSH_OFFSETOF |
#include <Compiler.h>
Disables invalid-offsetof gcc and clang warning.
| #define SC_COMPILER_WARNING_PUSH_UNUSED_RESULT _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wunused-result\"") |
#include <Compiler.h>
Disables unused-result warning (due to ignoring a return value marked as [[nodiscard]])
| #define SC_CONFIGURATION_DEBUG 0 |
#include <Platform.h>
True (1) if debug configuration is active (_DEBUG==1 or DEBUG==1)
| #define SC_CONFIGURATION_RELEASE 1 |
#include <Platform.h>
True (1) if release configuration is active (!(_DEBUG==1 or DEBUG==1))
| #define SC_LANGUAGE_CPP_AT_LEAST_14 0 |
#include <Compiler.h>
True (1) if C++ standard is <= C++ 14.
| #define SC_LANGUAGE_CPP_AT_LEAST_17 0 |
#include <Compiler.h>
True (1) if C++ standard is <= C++ 17.
| #define SC_LANGUAGE_CPP_AT_LEAST_20 0 |
#include <Compiler.h>
True (1) if C++ standard is <= C++ 20.
| #define SC_LANGUAGE_CPP_VERSION __cplusplus |
#include <Compiler.h>
SC_LANGUAGE_FORCE_STANDARD_CPP == 14, 17 or 20 to force a specific C++ standard version.
Macro to check __cplusplus properly on MSVC
| #define SC_TRUST_RESULT | ( | expression | ) |