载入中...
搜索中...
未找到
Assert.h 文件参考
EVEngine assertion entry point, backed by zeroerr. 更多...
#include "zeroerr/assert.h"宏定义 | |
| #define | EV_PARAM_CHECK(cond, ...) ASSERT(cond, ##__VA_ARGS__) |
| Validate a function parameter / public API precondition. | |
| #define | EV_ASSERT(cond, ...) ASSERT(cond, ##__VA_ARGS__) |
| Assert an internal engine invariant (state that must always hold). | |
详细描述
EVEngine assertion entry point, backed by zeroerr.
All parameter validation and internal invariant checks in the engine should go through the macros defined here (or use zeroerr's ASSERT family directly).
Build policy:
- Debug builds: checks are compiled in and always active.
- Release / other configurations: checks are compiled out by default (CMake defines ZEROERR_NO_ASSERT), so there is zero runtime cost.
- To force checks on in non-Debug builds, configure with
-DEVENGINE_ENABLE_ASSERTS=ON(ormake ... CMAKE_EXTRA_ARGS=-DEVENGINE_ENABLE_ASSERTS=ON).
A failed check throws zeroerr::AssertionData (a std::exception) carrying the file, line, decomposed expression and an optional message.
在文件 Assert.h 中定义.
宏定义说明
◆ EV_ASSERT
| #define EV_ASSERT | ( | cond, | |
| ... | |||
| ) | ASSERT(cond, ##__VA_ARGS__) |
◆ EV_PARAM_CHECK
| #define EV_PARAM_CHECK | ( | cond, | |
| ... | |||
| ) | ASSERT(cond, ##__VA_ARGS__) |