TRLC Platform Library
1.0.0
Header-only C++ library for compile-time platform detection and abstraction
|
Portable debug and assertion utilities. More...
#include <atomic>
#include <cstdlib>
#include <iostream>
#include <string>
Go to the source code of this file.
Classes | |
class | trlc::platform::DebugUtils |
Debug utilities class with static methods. More... | |
Namespaces | |
trlc | |
trlc::platform | |
Macros | |
#define | TRLC_DEBUG_BUILD 1 |
#define | TRLC_ASSERT(expr) |
#define | TRLC_DEBUG_ONLY(code) code |
#define | TRLC_UNREACHABLE() trlc::platform::DebugUtils::unreachable() |
#define | TRLC_ABORT(msg) trlc::platform::DebugUtils::abort(msg) |
#define | TRLC_DEBUG_BREAK() trlc::platform::DebugUtils::debugBreak() |
Typedefs | |
using | trlc::platform::AssertionHandler = void(*)(const char *expression, const char *file, int line, const char *function) |
Assertion handler function pointer type. More... | |
Functions | |
void | trlc::platform::defaultAssertionHandler (const char *expression, const char *file, int line, const char *function) |
Default assertion handler implementation. More... | |
static bool | trlc::platform::isDebugBuild () |
static bool | trlc::platform::isReleaseBuild () |
Check if the current build is a release build. More... | |
static bool | trlc::platform::hasDebugInfo () |
Check if debug information is available. More... | |
Portable debug and assertion utilities.
This header provides comprehensive debug utilities including assertion handling, debug mode detection, breakpoint support, and stack trace capabilities. It offers portable implementations that work across different platforms and compilers.
Features:
All debug utilities are designed to be zero-overhead in release builds while providing comprehensive debugging support in development builds.
Definition in file debug.hpp.
#define TRLC_ABORT | ( | msg | ) | trlc::platform::DebugUtils::abort(msg) |
#define TRLC_ASSERT | ( | expr | ) |
#define TRLC_DEBUG_BREAK | ( | ) | trlc::platform::DebugUtils::debugBreak() |
#define TRLC_UNREACHABLE | ( | ) | trlc::platform::DebugUtils::unreachable() |