Files
OpenRCT2-Web/src/core/Guard.cpp
T

53 lines
1.4 KiB
C++
Raw Normal View History

#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
2016-04-10 17:01:16 +01:00
#include <cassert>
#include <stdio.h>
#include "Console.hpp"
#include "Diagnostics.hpp"
#include "Guard.hpp"
namespace Guard
{
void Assert(bool expression, const char * message)
{
if (expression) return;
if (message != nullptr)
{
Console::Error::WriteLine(message);
}
2016-07-11 19:09:16 +01:00
#if DEBUG
Debug::Break();
#endif
assert(false);
}
void Fail(const char * message)
{
if (message != nullptr)
{
Console::Error::WriteLine(message);
}
2016-04-10 17:01:16 +01:00
#if DEBUG
Debug::Break();
#endif
assert(false);
}
}