sead
Loading...
Searching...
No Matches
seadAssert.h
Go to the documentation of this file.
1#pragma once
2
3#include <basis/seadTypes.h>
4
5#if defined(SEAD_TARGET_DEBUG)
6 #define SEAD_ASSERT(condition)
7 do
8 {
9 if (!(condition))
10 {
11 sead::system::HaltWithDetailNoFormat(__FILE__, __LINE__, #condition);
12 }
13 } while (0)
14
15 #define SEAD_ASSERT_MSG(condition, format, ...)
16 do
17 {
18 if (!(condition))
19 {
20 sead::system::HaltWithDetail(__FILE__, __LINE__, format, ##__VA_ARGS__);
21 }
22 } while (0)
23#else
24 #define SEAD_ASSERT(condition)
25 do
26 {
27 if (false)
28 {
29 static_cast<void>(condition);
30 }
31 } while (0)
32
33 #define SEAD_ASSERT_MSG(condition, format, ...)
34 do
35 {
36 if (false)
37 {
38 static_cast<void>(condition);
39 sead::system::HaltWithDetail(nullptr, 0, format, ##__VA_ARGS__);
40 }
41 } while (0)
42#endif // SEAD_TARGET_DEBUG
43
44namespace sead { namespace system {
45
47void Halt();
48void HaltWithDetail(const char* pos, s32 line, const char* format, ...);
49void HaltWithDetailNoFormat(const char* pos, s32 line, const char* str);
50
51#if defined(SEAD_PLATFORM_WINDOWS)
53#endif // SEAD_PLATFORM_WINDOWS
54
55} } // namespace sead::system
Definition seadAssert.h:44
void HaltWithDetailNoFormat(const char *pos, s32 line, const char *str)
void HaltWithDetail(const char *pos, s32 line, const char *format,...)
void DebugBreak()
Definition seadAssert.h:44