2014-12-17 06:38:14 +01:00
|
|
|
// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
2013-09-05 02:17:46 +02:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2014-08-17 19:45:50 +02:00
|
|
|
#pragma once
|
2013-09-05 02:17:46 +02:00
|
|
|
|
2014-12-04 21:57:00 +01:00
|
|
|
#include "common/common_funcs.h"
|
|
|
|
#include "common/msg_handler.h"
|
2014-10-28 08:36:00 +01:00
|
|
|
#include "common/logging/log.h"
|
2013-09-05 02:17:46 +02:00
|
|
|
|
2014-11-29 06:38:20 +01:00
|
|
|
#ifdef MSVC_VER
|
2014-05-30 05:03:03 +02:00
|
|
|
#ifndef __func__
|
|
|
|
#define __func__ __FUNCTION__
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2014-12-07 00:14:14 +01:00
|
|
|
#if _DEBUG
|
2013-09-05 02:17:46 +02:00
|
|
|
#define _dbg_assert_(_t_, _a_) \
|
2014-04-02 00:20:08 +02:00
|
|
|
if (!(_a_)) {\
|
2014-12-06 02:53:49 +01:00
|
|
|
LOG_CRITICAL(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \
|
2014-04-02 00:20:08 +02:00
|
|
|
__LINE__, __FILE__, __TIME__); \
|
|
|
|
if (!PanicYesNo("*** Assertion (see log)***\n")) {Crash();} \
|
|
|
|
}
|
2013-09-05 02:17:46 +02:00
|
|
|
#define _dbg_assert_msg_(_t_, _a_, ...)\
|
2014-04-02 00:20:08 +02:00
|
|
|
if (!(_a_)) {\
|
2014-12-06 02:53:49 +01:00
|
|
|
LOG_CRITICAL(_t_, __VA_ARGS__); \
|
2014-04-02 00:20:08 +02:00
|
|
|
if (!PanicYesNo(__VA_ARGS__)) {Crash();} \
|
|
|
|
}
|
2013-09-05 02:17:46 +02:00
|
|
|
#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 00:14:14 +01:00
|
|
|
#endif
|
2013-09-05 02:17:46 +02:00
|
|
|
|
|
|
|
#define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_)
|
|
|
|
|
|
|
|
#ifndef GEKKO
|
|
|
|
#ifdef _WIN32
|
2014-04-02 00:20:08 +02:00
|
|
|
#define _assert_msg_(_t_, _a_, _fmt_, ...) \
|
|
|
|
if (!(_a_)) {\
|
|
|
|
if (!PanicYesNo(_fmt_, __VA_ARGS__)) {Crash();} \
|
|
|
|
}
|
2014-11-29 06:38:20 +01:00
|
|
|
#else // not msvc
|
2014-04-02 00:20:08 +02:00
|
|
|
#define _assert_msg_(_t_, _a_, _fmt_, ...) \
|
|
|
|
if (!(_a_)) {\
|
|
|
|
if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \
|
|
|
|
}
|
2014-12-30 04:47:41 +01:00
|
|
|
#endif // _WIN32
|
2013-09-05 02:17:46 +02:00
|
|
|
#else // GEKKO
|
|
|
|
#define _assert_msg_(_t_, _a_, _fmt_, ...)
|
2014-12-30 04:47:41 +01:00
|
|
|
#endif
|