mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Add new assert/log facility _dbg_assert_or_log_. Asserts in debug builds, logs in release builds.
This commit is contained in:
1 parent
b7782d98f3
commit
bc283ac60e
1 file changed
+19
@@ -141,16 +141,35 @@ void SetCleanExitOnAssert();
|
||||
if (!HandleAssert(__FUNCTION__, __FILENAME__, __LINE__, #_a_, "Assert!\n")) Crash(); \
|
||||
}
|
||||
|
||||
#define _dbg_assert_or_log_(_a_) \
|
||||
if (!(_a_)) {\
|
||||
if (!HandleAssert(__FUNCTION__, __FILENAME__, __LINE__, #_a_, "Assert!\n")) Crash(); \
|
||||
}
|
||||
|
||||
#define _dbg_assert_msg_(_a_, ...) \
|
||||
if (!(_a_)) { \
|
||||
if (!HandleAssert(__FUNCTION__, __FILENAME__, __LINE__, #_a_, __VA_ARGS__)) Crash(); \
|
||||
}
|
||||
|
||||
#define _dbg_assert_msg_or_log_(_a_, log, ...) \
|
||||
if (!(_a_)) { \
|
||||
if (!HandleAssert(__FUNCTION__, __FILENAME__, __LINE__, #_a_, __VA_ARGS__)) Crash(); \
|
||||
}
|
||||
|
||||
#else // not debug
|
||||
|
||||
#ifndef _dbg_assert_
|
||||
#define _dbg_assert_(_a_) {}
|
||||
#define _dbg_assert_or_log_(_a_) \
|
||||
if (!(_a_)) { \
|
||||
ERROR_LOG(Log::System, "Assert! " ## #_a_); \
|
||||
}
|
||||
#define _dbg_assert_msg_(_a_, _desc_, ...) {}
|
||||
#define _dbg_assert_msg_or_log_(_a_, log, ...) \
|
||||
if (!(_a_)) { \
|
||||
ERROR_LOG(log, __VA_ARGS__); \
|
||||
}
|
||||
|
||||
#endif // dbg_assert
|
||||
|
||||
#endif // MAX_LOGLEVEL DEBUG
|
||||
|
||||
Reference in new issue
Block a user