diff options
Diffstat (limited to 'Private/NewKit')
| -rw-r--r-- | Private/NewKit/RuntimeCheck.hpp | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/Private/NewKit/RuntimeCheck.hpp b/Private/NewKit/RuntimeCheck.hpp index c5978aad..4a10d31c 100644 --- a/Private/NewKit/RuntimeCheck.hpp +++ b/Private/NewKit/RuntimeCheck.hpp @@ -12,46 +12,41 @@ #include <NewKit/Defines.hpp> -namespace HCore -{ -void runtime_check(bool bExpression, const char *file, const char *line); +namespace HCore { +void ke_runtime_check(bool bExpression, const char *file, const char *line); } #define MUST_PASS_COMPILER(EXPR, MSG) static_assert(EXPR, MSG) -#define MUST_PASS(EXPR) HCore::runtime_check(EXPR, __FILE__, " %d -> ") +#define MUST_PASS(EXPR) HCore::ke_runtime_check(EXPR, __FILE__, " %d -> ") #define assert(EXPR) MUST_PASS(EXPR, RUNTIME_CHECK_EXPRESSION) -enum RUNTIME_CHECK -{ - RUNTIME_CHECK_FAILED = -1, - RUNTIME_CHECK_POINTER = 0, - RUNTIME_CHECK_EXPRESSION, - RUNTIME_CHECK_FILE, - RUNTIME_CHECK_IPC, - RUNTIME_CHECK_TLS, - RUNTIME_CHECK_LD, - RUNTIME_CHECK_HANDSHAKE, - RUNTIME_CHECK_ACPI, - RUNTIME_CHECK_INVALID_PRIVILEGE, - RUNTIME_CHECK_PROCESS, - RUNTIME_CHECK_BAD_BEHAVIOR, - RUNTIME_CHECK_COUNT, - RUNTIME_CHECK_BOOTSTRAP, +enum RUNTIME_CHECK { + RUNTIME_CHECK_FAILED = -1, + RUNTIME_CHECK_POINTER = 0, + RUNTIME_CHECK_EXPRESSION, + RUNTIME_CHECK_FILE, + RUNTIME_CHECK_IPC, + RUNTIME_CHECK_TLS, + RUNTIME_CHECK_LD, + RUNTIME_CHECK_HANDSHAKE, + RUNTIME_CHECK_ACPI, + RUNTIME_CHECK_INVALID_PRIVILEGE, + RUNTIME_CHECK_PROCESS, + RUNTIME_CHECK_BAD_BEHAVIOR, + RUNTIME_CHECK_COUNT, + RUNTIME_CHECK_BOOTSTRAP, }; -namespace HCore -{ -class DumpManager final -{ - public: - static void Dump(void) - { - // TODO: - } +namespace HCore { +class DumpManager final { + public: + static void Dump(void) { + // TODO: + } }; void ke_stop(const Int &id); -} // namespace HCore +} // namespace HCore #ifdef TRY #undef TRY @@ -59,8 +54,7 @@ void ke_stop(const Int &id); #define INIT(OBJ, TYPE, ...) TYPE OBJ = TYPE(__VA_ARGS__) -#define TRY(FN) \ - if (!FN()) \ - { \ - MUST_PASS(false); \ - } +#define TRY(FN) \ + if (!FN()) { \ + MUST_PASS(false); \ + } |
