2013-09-05 05:47:46 +05:30
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2014-08-17 23:15:50 +05:30
|
|
|
#pragma once
|
2013-09-05 05:47:46 +05:30
|
|
|
|
2014-12-05 02:27:00 +05:30
|
|
|
#include "common/common_funcs.h"
|
|
|
|
#include "common/msg_handler.h"
|
2014-10-28 13:06:00 +05:30
|
|
|
#include "common/logging/log.h"
|
2014-12-05 02:27:00 +05:30
|
|
|
|
2014-05-30 08:33:03 +05:30
|
|
|
#ifdef _WIN32
|
|
|
|
#ifndef __func__
|
|
|
|
#define __func__ __FUNCTION__
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2014-12-07 04:44:14 +05:30
|
|
|
#if _DEBUG
|
2013-09-05 05:47:46 +05:30
|
|
|
#define _dbg_assert_(_t_, _a_) \
|
2014-04-02 03:50:08 +05:30
|
|
|
if (!(_a_)) {\
|
2014-12-06 07:23:49 +05:30
|
|
|
LOG_CRITICAL(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \
|
2014-04-02 03:50:08 +05:30
|
|
|
__LINE__, __FILE__, __TIME__); \
|
|
|
|
if (!PanicYesNo("*** Assertion (see log)***\n")) {Crash();} \
|
|
|
|
}
|
2013-09-05 05:47:46 +05:30
|
|
|
#define _dbg_assert_msg_(_t_, _a_, ...)\
|
2014-04-02 03:50:08 +05:30
|
|
|
if (!(_a_)) {\
|
2014-12-06 07:23:49 +05:30
|
|
|
LOG_CRITICAL(_t_, __VA_ARGS__); \
|
2014-04-02 03:50:08 +05:30
|
|
|
if (!PanicYesNo(__VA_ARGS__)) {Crash();} \
|
|
|
|
}
|
2013-09-05 05:47:46 +05:30
|
|
|
#define _dbg_update_() Host_UpdateLogDisplay();
|
|
|
|
|
|
|
|
#else // not debug
|
|
|
|
#define _dbg_update_() ;
|
|
|
|
|
|
|
|
#ifndef _dbg_assert_
|
|
|
|
#define _dbg_assert_(_t_, _a_) {}
|
|
|
|
#define _dbg_assert_msg_(_t_, _a_, _desc_, ...) {}
|
|
|
|
#endif // dbg_assert
|
2014-12-07 04:44:14 +05:30
|
|
|
#endif
|
2013-09-05 05:47:46 +05:30
|
|
|
|
|
|
|
#define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_)
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
2014-04-02 03:50:08 +05:30
|
|
|
#define _assert_msg_(_t_, _a_, _fmt_, ...) \
|
|
|
|
if (!(_a_)) {\
|
|
|
|
if (!PanicYesNo(_fmt_, __VA_ARGS__)) {Crash();} \
|
|
|
|
}
|
2013-09-05 05:47:46 +05:30
|
|
|
#else // not win32
|
2014-04-02 03:50:08 +05:30
|
|
|
#define _assert_msg_(_t_, _a_, _fmt_, ...) \
|
|
|
|
if (!(_a_)) {\
|
|
|
|
if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \
|
|
|
|
}
|
2013-09-05 05:47:46 +05:30
|
|
|
#endif // WIN32
|