mirror of
https://github.com/tribes2/engine.git
synced 2026-03-17 03:10:42 +00:00
t2 engine svn checkout
This commit is contained in:
commit
ff569bd2ae
988 changed files with 394180 additions and 0 deletions
77
platform/platformAssert.h
Normal file
77
platform/platformAssert.h
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// V12 Engine
|
||||
//
|
||||
// Copyright (c) 2001 GarageGames.Com
|
||||
// Portions Copyright (c) 2001 by Sierra Online, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _PLATFORMASSERT_H_
|
||||
#define _PLATFORMASSERT_H_
|
||||
|
||||
|
||||
#ifndef _PLATFORM_H_
|
||||
#include "Platform/platform.h"
|
||||
#endif
|
||||
|
||||
|
||||
class PlatformAssert
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
Warning = 3,
|
||||
Fatal = 2,
|
||||
Fatal_ISV = 1
|
||||
};
|
||||
|
||||
private:
|
||||
static PlatformAssert *platformAssert;
|
||||
bool processing;
|
||||
|
||||
bool displayMessageBox(const char *title, const char *message, bool retry);
|
||||
void process(Type assertType,
|
||||
const char* filename,
|
||||
U32 lineNumber,
|
||||
const char* message);
|
||||
|
||||
PlatformAssert();
|
||||
|
||||
public:
|
||||
static void create();
|
||||
static void destroy();
|
||||
static void processAssert(Type assertType,
|
||||
const char* filename,
|
||||
U32 lineNumber,
|
||||
const char* message);
|
||||
static char* message(const char *message, ...);
|
||||
static bool processingAssert();
|
||||
};
|
||||
|
||||
|
||||
#ifdef ENABLE_ASSERTS
|
||||
#define AssertWarn(x, y) \
|
||||
{ if (!bool(x)) \
|
||||
PlatformAssert::processAssert(PlatformAssert::Warning, __FILE__, __LINE__, y); }
|
||||
|
||||
#define AssertFatal(x, y) \
|
||||
{ if (!bool(x)) \
|
||||
PlatformAssert::processAssert(PlatformAssert::Fatal, __FILE__, __LINE__, y); }
|
||||
|
||||
// #define AssertFatal(x, y) { }
|
||||
|
||||
#else
|
||||
#define AssertFatal(x, y) { }
|
||||
#define AssertWarn(x, y) { }
|
||||
#endif
|
||||
|
||||
|
||||
#define AssertISV(x, y) \
|
||||
{ if (!bool(x)) \
|
||||
PlatformAssert::processAssert(PlatformAssert::Fatal_ISV, __FILE__, __LINE__, y); }
|
||||
|
||||
|
||||
const char* avar(const char *in_msg, ...);
|
||||
|
||||
|
||||
|
||||
#endif // _PLATFORM_ASSERT_H_
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue