NkCompilerDetect.h
#include "NKPlatform/NkCompilerDetect.h"nkentseudependson(["NKPlatform"])Aliases · 2
NKENTSEU_int128 | Signed 128-bit integer type |
NKENTSEU_uint128 | Unsigned 128-bit integer type |
Macros · 94
NKENTSEU_COMPILER_MSVC | Detection macro for MSVC (Microsoft Visual C++) |
NKENTSEU_COMPILER_VERSION | Numeric compiler version |
NKENTSEU_COMPILER_MSVC_2024 | MSVC 2024 or later (VS 17.10+) |
NKENTSEU_COMPILER_MSVC_2022 | MSVC 2022 or later (VS 17.0+) |
NKENTSEU_COMPILER_MSVC_2019 | MSVC 2019 or later (VS 16.0+) |
NKENTSEU_COMPILER_MSVC_2017 | MSVC 2017 or later (VS 15.0+) |
NKENTSEU_COMPILER_CLANG | Detection of the Clang (LLVM) compiler |
NKENTSEU_COMPILER_APPLE_CLANG | Detection of Apple Clang |
NKENTSEU_COMPILER_GCC | Detection of the GCC compiler |
NKENTSEU_COMPILER_INTEL | Detection of the Intel C++ compiler |
NKENTSEU_COMPILER_EMSCRIPTEN | Detection of the Emscripten compiler |
NKENTSEU_COMPILER_NVCC | Detection of the NVCC (CUDA) compiler |
NKENTSEU_COMPILER_SUNPRO | Detection of the SunPro/Oracle compiler |
NKENTSEU_COMPILER_XLC | Detection of the IBM XL C/C++ compiler |
NKENTSEU_CPP23 | C++23 standard or later |
NKENTSEU_CPP_VERSION | The C++ standard version being compiled, as a number (23, 20, 17...). |
NKENTSEU_CPP20 | C++20 standard or later |
NKENTSEU_CPP17 | C++17 standard or later |
NKENTSEU_CPP14 | C++14 standard or later |
NKENTSEU_CPP11 | C++11 standard or later |
NKENTSEU_CPP98 | C++98/C++03 standard |
NKENTSEU_HAS_CPP11 | General C++11 support |
NKENTSEU_HAS_NULLPTR | Support for the nullptr keyword |
NKENTSEU_HAS_AUTO | Support for the auto keyword for type inference |
NKENTSEU_HAS_DECLTYPE | Support for decltype for type inspection |
NKENTSEU_HAS_RVALUE_REFERENCES | Support for rvalue references and move semantics |
NKENTSEU_HAS_VARIADIC_TEMPLATES | Support for variadic templates |
NKENTSEU_HAS_STATIC_ASSERT | Support for static_assert for compile-time assertions |
NKENTSEU_HAS_CONSTEXPR | Support for constexpr for compile-time evaluation |
NKENTSEU_HAS_NOEXCEPT | Support for noexcept to state that no exception is thrown |
NKENTSEU_HAS_OVERRIDE | Support for the override specifier on virtual methods |
NKENTSEU_HAS_FINAL | Support for the final specifier to prevent inheritance |
NKENTSEU_HAS_DEFAULT_DELETE | Support for default/delete functions |
NKENTSEU_HAS_LAMBDA | Support for lambda expressions |
NKENTSEU_HAS_RANGE_FOR | Support for range-based for loops |
NK_CPP11 | Historical alias of NKENTSEU_HAS_CPP11, used by the NKContainers guards (#if defined(NK_CPP11): move, forwarding, noexcept). |
NKENTSEU_HAS_CPP14 | General C++14 support |
NKENTSEU_HAS_GENERIC_LAMBDAS | Support for generic lambdas (auto parameters) |
NKENTSEU_HAS_VARIABLE_TEMPLATES | Support for variable templates |
NKENTSEU_HAS_RELAXED_CONSTEXPR | Support for relaxed constexpr (more expressions allowed) |
NKENTSEU_HAS_BINARY_LITERALS | Support for binary literals (0b1010) |
NKENTSEU_HAS_DECLTYPE_AUTO | Support for decltype(auto) for perfect type inference |
NKENTSEU_HAS_CPP17 | General C++17 support |
NKENTSEU_HAS_INLINE_VARIABLES | Support for inline variables (definition in headers) |
NKENTSEU_HAS_FOLD_EXPRESSIONS | Support for fold expressions on variadic templates |
NKENTSEU_HAS_IF_CONSTEXPR | Support for if constexpr for conditional compilation |
NKENTSEU_HAS_STRUCTURED_BINDINGS | Support for structured bindings to decompose tuples/structs |
NKENTSEU_HAS_CONSTEXPR_IF | Alias for NKENTSEU_HAS_IF_CONSTEXPR (naming consistency) |
NKENTSEU_HAS_NODISCARD | Support for the [[nodiscard]] attribute |
NKENTSEU_HAS_MAYBE_UNUSED | Support for the [[maybe_unused]] attribute |
NKENTSEU_HAS_FALLTHROUGH | Support for the [[fallthrough]] attribute in switches |
NKENTSEU_HAS_CPP20 | General C++20 support |
NKENTSEU_HAS_CONCEPTS | Support for concepts to constrain templates |
NKENTSEU_HAS_MODULES | Support for modules for modular compilation |
NKENTSEU_HAS_COROUTINES | Support for coroutines for asynchronous programming |
NKENTSEU_HAS_CONSTEXPR_VIRTUAL | Support for constexpr on virtual functions |
NKENTSEU_HAS_CONSTEVAL | Support for consteval for immediate compile-time evaluation |
NKENTSEU_HAS_CONSTINIT | Support for constinit for guaranteed static initialisation |
NKENTSEU_HAS_THREE_WAY_COMPARISON | Support for the three-way comparison operator (<=>) |
NKENTSEU_HAS_DESIGNATED_INITIALIZERS | Support for designated initializers |
NKENTSEU_HAS_CPP23 | General C++23 support |
NKENTSEU_HAS_DEDUCING_THIS | Support for 'deducing this' for explicit object methods |
NKENTSEU_HAS_IF_CONSTEVAL | Support for if consteval to detect constant evaluation |
NKENTSEU_HAS_MULTIDIMENSIONAL_SUBSCRIPT | Support for multidimensional subscripts (obj[1, 2, 3]) |
NKENTSEU_CONSTEXPR | Portable macro for constexpr |
NKENTSEU_NOEXCEPT | Portable macro for noexcept |
NKENTSEU_NOEXCEPT_IF | Macro for conditional noexcept |
NKENTSEU_OVERRIDE | Portable macro for override |
NKENTSEU_FINAL | Portable macro for final |
NKENTSEU_NODISCARD | Portable macro for [[nodiscard]] |
NKENTSEU_NODISCARD_MSG | [[nodiscard]] with a custom message |
NKENTSEU_NODISCARD_SIMPLE | Simple alias for [[nodiscard]] |
NKENTSEU_MAYBE_UNUSED | Portable macro for [[maybe_unused]] |
NKENTSEU_FALLTHROUGH | Portable macro for [[fallthrough]] |
NKENTSEU_PACKED | Packed structure (no memory padding) |
NKENTSEU_PACK_BEGIN | Start of a packed block with push/pop |
NKENTSEU_PACK_END | End of a packed block |
NKENTSEU_RESTRICT | restrict keyword for pointers without aliasing |
NKENTSEU_THREAD_LOCAL | Thread-local storage (one variable per thread) |
NKENTSEU_DEPRECATED | deprecated attribute with an optional message |
NKENTSEU_DEPRECATED_MSG | deprecated attribute with a custom message |
NKENTSEU_FUNCTION_NAME | Decorated name of the current function (with its full signature) |
NKENTSEU_FILE_NAME | Path of the current source file |
NKENTSEU_LINE_NUMBER | Current source line number |
NKENTSEU_HAS_RTTI | RTTI (Run-Time Type Information) support |
NKENTSEU_HAS_EXCEPTIONS | C++ exceptions support |
NKENTSEU_HAS_INT128 | 128-bit integer support (__int128) |
NKENTSEU_PRAGMA | Macro to emit a pragma portably |
NKENTSEU_DISABLE_WARNING_PUSH | Saves the current warning state (push) |
NKENTSEU_DISABLE_WARNING_POP | Restores the warning state after a push (pop) |
NKENTSEU_DISABLE_WARNING | Disables a specific warning |
NKENTSEU_DISABLE_WARNING_MSVC | Disables an MSVC warning; does nothing with another compiler. |
NKENTSEU_DISABLE_WARNING_CLANG | Disables a Clang warning; does nothing with another compiler. |
NKENTSEU_DISABLE_WARNING_GCC | Disables a GCC warning; does nothing with another compiler. |
Member details
Detection macro for MSVC (Microsoft Visual C++)
#ifdef NKENTSEU_COMPILER_MSVC // Code spécifique à MSVC #pragma warning(disable: 4100) #endif
Numeric compiler version
MSVC 2024 or later (VS 17.10+)
MSVC 2022 or later (VS 17.0+)
MSVC 2019 or later (VS 16.0+)
MSVC 2017 or later (VS 15.0+)
Detection of the Clang (LLVM) compiler
Detection of Apple Clang
Detection of the GCC compiler
Detection of the Intel C++ compiler
Detection of the Emscripten compiler
Detection of the NVCC (CUDA) compiler
Detection of the SunPro/Oracle compiler
Detection of the IBM XL C/C++ compiler
C++23 standard or later
The C++ standard version being compiled, as a number (23, 20, 17...).
C++20 standard or later
C++17 standard or later
C++14 standard or later
C++11 standard or later
C++98/C++03 standard
General C++11 support
Support for the nullptr keyword
Support for the auto keyword for type inference
Support for decltype for type inspection
Support for rvalue references and move semantics
Support for variadic templates
Support for static_assert for compile-time assertions
Support for constexpr for compile-time evaluation
Support for noexcept to state that no exception is thrown
Support for the override specifier on virtual methods
Support for the final specifier to prevent inheritance
Support for default/delete functions
Support for lambda expressions
Support for range-based for loops
Historical alias of NKENTSEU_HAS_CPP11, used by the NKContainers guards (#if defined(NK_CPP11): move, forwarding, noexcept).
General C++14 support
Support for generic lambdas (auto parameters)
Support for variable templates
Support for relaxed constexpr (more expressions allowed)
Support for binary literals (0b1010)
Support for decltype(auto) for perfect type inference
General C++17 support
Support for inline variables (definition in headers)
Support for fold expressions on variadic templates
Support for if constexpr for conditional compilation
Support for structured bindings to decompose tuples/structs
Alias for NKENTSEU_HAS_IF_CONSTEXPR (naming consistency)
Support for the [[nodiscard]] attribute
Support for the [[maybe_unused]] attribute
Support for the [[fallthrough]] attribute in switches
General C++20 support
Support for concepts to constrain templates
Support for modules for modular compilation
Support for coroutines for asynchronous programming
Support for constexpr on virtual functions
Support for consteval for immediate compile-time evaluation
Support for constinit for guaranteed static initialisation
Support for the three-way comparison operator (<=>)
Support for designated initializers
General C++23 support
Support for 'deducing this' for explicit object methods
Support for if consteval to detect constant evaluation
Support for multidimensional subscripts (obj[1, 2, 3])
Portable macro for constexpr
NKENTSEU_CONSTEXPR int Square(int x) { return x * x; }
Portable macro for noexcept
Macro for conditional noexcept
Portable macro for override
Portable macro for final
Portable macro for [[nodiscard]]
[[nodiscard]] with a custom message
Simple alias for [[nodiscard]]
Portable macro for [[maybe_unused]]
Portable macro for [[fallthrough]]
Packed structure (no memory padding)
struct NKENTSEU_PACKED NetworkHeader { uint16_t type; uint32_t length; // Pas de padding entre type et length };
Start of a packed block with push/pop
End of a packed block
restrict keyword for pointers without aliasing
void CopyBuffer( float* NKENTSEU_RESTRICT dest, const float* NKENTSEU_RESTRICT src, size_t count );
Thread-local storage (one variable per thread)
NKENTSEU_THREAD_LOCAL int g_ThreadLocalCounter = 0;
deprecated attribute with an optional message
deprecated attribute with a custom message
NKENTSEU_DEPRECATED_MSG("Utiliser NewFunction() à la place") void OldFunction();
Decorated name of the current function (with its full signature)
void DebugLog(const char* msg) { printf("[%s] %s\n", NKENTSEU_FUNCTION_NAME, msg); }
Path of the current source file
Current source line number
RTTI (Run-Time Type Information) support
C++ exceptions support
128-bit integer support (__int128)
Signed 128-bit integer type
Unsigned 128-bit integer type
Macro to emit a pragma portably
NKENTSEU_PRAGMA(optimize("O3")) // GCC/Clang NKENTSEU_PRAGMA(warning(disable: 4100)) // MSVC
Saves the current warning state (push)
Restores the warning state after a push (pop)
Disables a specific warning
// MSVC : désactiver warning 4100 (paramètre unused) NKENTSEU_DISABLE_WARNING_PUSH NKENTSEU_DISABLE_WARNING(4100) void Func(int unused) { } NKENTSEU_DISABLE_WARNING_POP // GCC/Clang : désactiver warning "-Wunused-parameter" NKENTSEU_DISABLE_WARNING_PUSH NKENTSEU_DISABLE_WARNING("-Wunused-parameter") void Func(int unused) { } NKENTSEU_DISABLE_WARNING_POP
Disables an MSVC warning; does nothing with another compiler.
Disables a Clang warning; does nothing with another compiler.
Disables a GCC warning; does nothing with another compiler.