|
TRLC Platform Library
1.0.0
Header-only C++ library for compile-time platform detection and abstraction
|
Compiler detection and capability utilities. More...
Go to the source code of this file.
Classes | |
| struct | trlc::platform::CompilerVersion |
| struct | trlc::platform::CompilerInfo |
| Consolidated compiler information structure. More... | |
Namespaces | |
| trlc | |
| trlc::platform | |
Macros | |
| #define | TRLC_COMPILER_GCC 0 |
| Check if current compiler is GCC (preprocessor-compatible) More... | |
| #define | TRLC_COMPILER_CLANG 0 |
| Check if current compiler is Clang (preprocessor-compatible) More... | |
| #define | TRLC_COMPILER_MSVC 0 |
| Check if current compiler is MSVC (preprocessor-compatible) More... | |
| #define | TRLC_COMPILER_INTEL 0 |
| Check if current compiler is Intel Classic (preprocessor-compatible) More... | |
| #define | TRLC_COMPILER_INTEL_LLVM 0 |
| Check if current compiler is Intel LLVM-based (preprocessor-compatible) More... | |
| #define | TRLC_COMPILER_MINGW 0 |
| Check if current compiler is MinGW (preprocessor-compatible) More... | |
| #define | TRLC_COMPILER_VERSION_MAJOR 0 |
| Get compiler version components as preprocessor macros. More... | |
| #define | TRLC_COMPILER_VERSION_MINOR 0 |
| #define | TRLC_COMPILER_VERSION_PATCH 0 |
| #define | TRLC_COMPILER_VERSION_ATLEAST(major, minor, patch) |
| Check if compiler version is at least the specified version (preprocessor-compatible) More... | |
| #define | TRLC_COMPILER_VERSION (trlc::platform::getCompilerVersion()) |
| Get current compiler version as a CompilerVersion object (constexpr function) More... | |
| #define | TRLC_COMPILER_NAME (trlc::platform::getCompilerName()) |
| Get current compiler name as a string (constexpr function) More... | |
Enumerations | |
| enum class | trlc::platform::CompilerType : int { trlc::platform::unknown = 0 , trlc::platform::gcc , trlc::platform::clang , trlc::platform::msvc , trlc::platform::intel_classic , trlc::platform::intel_llvm , trlc::platform::mingw } |
| Compiler identification enumeration. More... | |
Functions | |
| static CompilerType | trlc::platform::getCompilerType () |
| Detects the current compiler type at compile time. More... | |
| static CompilerVersion | trlc::platform::getCompilerVersion () |
| Gets the compiler version at compile time. More... | |
| static const char * | trlc::platform::getCompilerName () |
| Gets the compiler name as a string. More... | |
| static bool | trlc::platform::hasBuiltinAttribute ([[maybe_unused]] const char *attribute_name) |
| Checks if compiler supports __builtin attributes. More... | |
| static bool | trlc::platform::supportsInlineAssembly () |
| Checks if compiler supports inline assembly. More... | |
| static bool | trlc::platform::hasColorDiagnostics () |
| Checks if compiler supports colored diagnostics. More... | |
| static CompilerInfo | trlc::platform::getCompilerInfo () |
| Get consolidated compiler information. More... | |
Compiler detection and capability utilities.
This header provides comprehensive compile-time compiler detection, version parsing, and capability checking for cross-platform C++ development. It enables code to adapt to different compiler capabilities and optimize for specific compiler features.
All functions in this header are thread-safe as they perform only compile-time evaluation and access no mutable state.
Definition in file compiler.hpp.
| #define TRLC_COMPILER_CLANG 0 |
Check if current compiler is Clang (preprocessor-compatible)
Definition at line 560 of file compiler.hpp.
| #define TRLC_COMPILER_GCC 0 |
Check if current compiler is GCC (preprocessor-compatible)
Definition at line 545 of file compiler.hpp.
| #define TRLC_COMPILER_INTEL 0 |
Check if current compiler is Intel Classic (preprocessor-compatible)
Definition at line 578 of file compiler.hpp.
| #define TRLC_COMPILER_INTEL_LLVM 0 |
Check if current compiler is Intel LLVM-based (preprocessor-compatible)
Definition at line 587 of file compiler.hpp.
| #define TRLC_COMPILER_MINGW 0 |
Check if current compiler is MinGW (preprocessor-compatible)
Definition at line 596 of file compiler.hpp.
| #define TRLC_COMPILER_MSVC 0 |
Check if current compiler is MSVC (preprocessor-compatible)
Definition at line 569 of file compiler.hpp.
| #define TRLC_COMPILER_NAME (trlc::platform::getCompilerName()) |
Get current compiler name as a string (constexpr function)
Definition at line 670 of file compiler.hpp.
| #define TRLC_COMPILER_VERSION (trlc::platform::getCompilerVersion()) |
Get current compiler version as a CompilerVersion object (constexpr function)
Definition at line 665 of file compiler.hpp.
| #define TRLC_COMPILER_VERSION_ATLEAST | ( | major, | |
| minor, | |||
| patch | |||
| ) |
Check if compiler version is at least the specified version (preprocessor-compatible)
| major | Minimum major version |
| minor | Minimum minor version |
| patch | Minimum patch version |
Definition at line 656 of file compiler.hpp.
| #define TRLC_COMPILER_VERSION_MAJOR 0 |
Get compiler version components as preprocessor macros.
Definition at line 645 of file compiler.hpp.
| #define TRLC_COMPILER_VERSION_MINOR 0 |
Definition at line 646 of file compiler.hpp.
| #define TRLC_COMPILER_VERSION_PATCH 0 |
Definition at line 647 of file compiler.hpp.