Compiler Macros Preprocessor macros to detect compiler and platform features. More...
Macros | |
#define | SC_ASSERT_RELEASE(e) |
Assert expression e to be true. More... | |
#define | SC_ASSERT_DEBUG(e) (void)0 |
Assert expression e to be true. More... | |
#define | SC_COMPILER_CLANG 0 |
Flag indicating Clang compiler. More... | |
#define | SC_COMPILER_GCC 1 |
Flag indicating GCC compiler. More... | |
#define | SC_COMPILER_MSVC 0 |
Flag indicating MSVC compiler. More... | |
#define | SC_COMPILER_CLANG_CL 0 |
Flag indicating non-Clang-CL (MSVC) compiler. More... | |
#define | SC_COMPILER_FORCE_INLINE __attribute__((always_inline)) inline |
Macro for forcing inline functions. More... | |
#define | SC_COMPILER_EXTERN |
Define compiler-specific export macros for DLL visibility. More... | |
#define | SC_COMPILER_EXPORT __attribute__((visibility("default"))) |
Macro for symbol visibility in non-MSVC compilers. More... | |
#define | SC_COMPILER_ASAN 0 |
Evaluates to true (1) if ASAN is active. More... | |
#define | SC_COMPILER_WARNING_POP _Pragma("warning(pop)") |
Pops warning from inside a macro. More... | |
#define | SC_COMPILER_OFFSETOF(Class, Field) __builtin_offsetof(Class, Field) |
Returns offset of Class::Field in bytes. More... | |
#define | SC_COMPILER_FIELD_OFFSET(Class, Field, Value) SC::fieldOffset<SC_COMPILER_OFFSETOF(Class, Field), Class, decltype(Class::Field)>(Value); |
#define | SC_COMPILER_WARNING_PUSH_OFFSETOF |
Disables invalid-offsetof gcc and clang warning. More... | |
#define | SC_COMPILER_UNUSED(param) ((void)param) |
Silence an unused variable or unused parameter warning. More... | |
#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]] ) More... | |
#define | SC_LANGUAGE_CPP_VERSION __cplusplus |
SC_LANGUAGE_FORCE_STANDARD_CPP == 14 , 17 or 20 to force a specific C++ standard version (202002L , 201703L or 201402L ) More... | |
#define | SC_LANGUAGE_CPP_LESS_THAN_20 1 |
True (1) if C++ standard is < C++ 20. More... | |
#define | SC_LANGUAGE_CPP_AT_LEAST_20 0 |
True (1) if C++ standard is <= C++ 20. More... | |
#define | SC_LANGUAGE_CPP_AT_LEAST_17 0 |
True (1) if C++ standard is <= C++ 17. More... | |
#define | SC_LANGUAGE_CPP_AT_LEAST_14 0 |
True (1) if C++ standard is <= C++ 14. More... | |
#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) More... | |
#define | SC_CONFIGURATION_RELEASE 1 |
True (1) if release configuration is active (!(_DEBUG==1 or DEBUG==1)) More... | |
Compiler Macros Preprocessor macros to detect compiler and platform features.
#define SC_ASSERT_DEBUG | ( | e | ) | (void)0 |
#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>
Evaluates to true (1) if ASAN is active.
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_EXPORT __attribute__((visibility("default"))) |
#include <Compiler.h>
Macro for symbol visibility in non-MSVC compilers.
#define SC_COMPILER_EXTERN |
#include <Compiler.h>
Define compiler-specific export macros for DLL visibility.
#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 | |||
) | __builtin_offsetof(Class, Field) |
#include <Compiler.h>
Returns offset of Class::Field in bytes.
#define SC_COMPILER_UNUSED | ( | param | ) | ((void)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_LESS_THAN_20 1 |
#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 (202002L
, 201703L
or 201402L
)
Macro to check __cplusplus
properly on MSVC