TRLC Platform Library
1.0.0
Header-only C++ library for compile-time platform detection and abstraction
|
Portable cross-platform macros for common C++ idioms and optimizations. More...
Go to the source code of this file.
Namespaces | |
trlc | |
trlc::platform | |
Functions | |
static bool | trlc::platform::supportsNodecard () |
Check if compiler supports nodiscard attribute. More... | |
static bool | trlc::platform::supportsDeprecated () |
Check if compiler supports deprecated attribute. More... | |
static bool | trlc::platform::supportsFallthrough () |
Check if compiler supports fallthrough attribute. More... | |
static bool | trlc::platform::hasAttributeSupport (const char *) |
Check if compiler supports a specific C++ attribute. More... | |
Portable cross-platform macros for common C++ idioms and optimizations.
This header provides a comprehensive set of portable macros that abstract compiler-specific features and attributes. All macros gracefully degrade on unsupported compilers while maintaining compatibility.
Features:
Definition in file macros.hpp.
#define TRLC_ALIGNED | ( | bytes | ) |
Definition at line 597 of file macros.hpp.
#define TRLC_API TRLC_API_IMPORT |
Definition at line 481 of file macros.hpp.
#define TRLC_API_EXPORT |
Definition at line 419 of file macros.hpp.
#define TRLC_API_HIDDEN |
Definition at line 461 of file macros.hpp.
#define TRLC_API_IMPORT |
Definition at line 440 of file macros.hpp.
#define TRLC_ARCH_ARM64 0 |
Definition at line 851 of file macros.hpp.
#define TRLC_ARCH_X86_64 0 |
Definition at line 843 of file macros.hpp.
#define TRLC_CACHE_ALIGNED TRLC_ALIGNED(64) |
Definition at line 610 of file macros.hpp.
#define TRLC_CONCAT | ( | a, | |
b | |||
) | a##b |
Definition at line 760 of file macros.hpp.
#define TRLC_CONCAT_EXPANDED | ( | a, | |
b | |||
) | TRLC_CONCAT(a, b) |
Definition at line 761 of file macros.hpp.
#define TRLC_DEPRECATED |
Definition at line 158 of file macros.hpp.
#define TRLC_DEPRECATED_MSG | ( | msg | ) | TRLC_DEPRECATED |
Definition at line 182 of file macros.hpp.
#define TRLC_DIAGNOSTIC_IGNORE_UNUSED_FUNCTION |
Definition at line 646 of file macros.hpp.
#define TRLC_DIAGNOSTIC_IGNORE_UNUSED_PARAMETER |
Definition at line 644 of file macros.hpp.
#define TRLC_DIAGNOSTIC_IGNORE_UNUSED_VARIABLE |
Definition at line 645 of file macros.hpp.
#define TRLC_DIAGNOSTIC_POP |
Definition at line 643 of file macros.hpp.
#define TRLC_DIAGNOSTIC_PUSH |
Definition at line 642 of file macros.hpp.
#define TRLC_FALLTHROUGH ((void)0) |
Definition at line 212 of file macros.hpp.
#define TRLC_FEATURE_AVAILABLE | ( | feature | ) | (TRLC_HAS_##feature) |
Definition at line 784 of file macros.hpp.
#define TRLC_FORCE_INLINE inline |
Definition at line 259 of file macros.hpp.
#define TRLC_HAS_BUILTIN | ( | x | ) | 0 |
Check if __has_builtin is available.
This macro provides a safe way to check for compiler builtin support. Returns 0 if __has_builtin is not available.
Definition at line 108 of file macros.hpp.
#define TRLC_HAS_CPP17 1 |
C++17 feature detection.
Detects if C++17 features are available. Works independently from cpp_standard.hpp for macros-only usage.
Definition at line 495 of file macros.hpp.
#define TRLC_HAS_CPP_ATTRIBUTE | ( | x | ) | 0 |
Check if __has_cpp_attribute is available.
This macro provides a safe way to check for C++ attribute support. Returns 0 if __has_cpp_attribute is not available. Note: MSVC doesn't support __has_cpp_attribute in C++17 mode.
Definition at line 96 of file macros.hpp.
#define TRLC_HAS_EXCEPTIONS_ENABLED 0 |
Definition at line 367 of file macros.hpp.
#define TRLC_IF | ( | condition, | |
code | |||
) |
Definition at line 668 of file macros.hpp.
#define TRLC_IF_ELSE | ( | condition, | |
then_code, | |||
else_code | |||
) |
Definition at line 692 of file macros.hpp.
#define TRLC_INLINE inline |
Definition at line 293 of file macros.hpp.
#define TRLC_LIKELY | ( | x | ) | (x) |
Definition at line 320 of file macros.hpp.
#define TRLC_MACROS_INCLUDED |
Definition at line 889 of file macros.hpp.
#define TRLC_MACROS_VERSION_AT_LEAST | ( | major, | |
minor, | |||
patch | |||
) |
Definition at line 882 of file macros.hpp.
#define TRLC_MACROS_VERSION_MAJOR 1 |
Macro version information.
Allows other components to check the version of the macros module.
Definition at line 863 of file macros.hpp.
#define TRLC_MACROS_VERSION_MINOR 0 |
Definition at line 864 of file macros.hpp.
#define TRLC_MACROS_VERSION_PATCH 0 |
Definition at line 865 of file macros.hpp.
#define TRLC_MACROS_VERSION_STRING "1.0.0" |
Definition at line 866 of file macros.hpp.
#define TRLC_MAYBE_UNUSED |
Definition at line 234 of file macros.hpp.
#define TRLC_NEVER_INLINE |
Definition at line 280 of file macros.hpp.
#define TRLC_NODISCARD |
Definition at line 135 of file macros.hpp.
#define TRLC_NOEXCEPT |
Definition at line 366 of file macros.hpp.
#define TRLC_NOEXCEPT_IF | ( | cond | ) |
Definition at line 391 of file macros.hpp.
#define TRLC_ON_ARM64 | ( | code | ) |
Definition at line 850 of file macros.hpp.
#define TRLC_ON_POSIX | ( | code | ) |
Definition at line 815 of file macros.hpp.
#define TRLC_ON_WINDOWS | ( | code | ) |
Definition at line 814 of file macros.hpp.
#define TRLC_ON_X86_64 | ( | code | ) |
Definition at line 842 of file macros.hpp.
#define TRLC_PACK_BEGIN |
Definition at line 569 of file macros.hpp.
#define TRLC_PACK_END |
Definition at line 570 of file macros.hpp.
#define TRLC_PACKED |
Definition at line 568 of file macros.hpp.
#define TRLC_PLATFORM_POSIX 0 |
Definition at line 817 of file macros.hpp.
#define TRLC_PLATFORM_WINDOWS 0 |
Definition at line 816 of file macros.hpp.
#define TRLC_RESTRICT |
Definition at line 544 of file macros.hpp.
#define TRLC_STRINGIFY | ( | x | ) | #x |
Definition at line 758 of file macros.hpp.
#define TRLC_STRINGIFY_EXPANDED | ( | x | ) | TRLC_STRINGIFY(x) |
Definition at line 759 of file macros.hpp.
#define TRLC_UNLIKELY | ( | x | ) | (x) |
Definition at line 344 of file macros.hpp.
#define TRLC_UNREACHABLE | ( | ) | ((void)0) |
Definition at line 744 of file macros.hpp.
#define TRLC_USE | ( | var | ) | ((void)(var)) |
Definition at line 722 of file macros.hpp.