TrinityCore
Errors.h File Reference
#include "Define.h"
#include <string>
+ Include dependency graph for Errors.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Trinity
 

Macros

#define ASSERT_BEGIN   __pragma(warning(push)) __pragma(warning(disable: 4127))
 
#define ASSERT_END   __pragma(warning(pop))
 
#define EXCEPTION_ASSERTION_FAILURE   0xC0000420L
 
#define WPAssert(cond, ...)   ASSERT_BEGIN do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, GetDebugInfo(), #cond, ##__VA_ARGS__); } while(0) ASSERT_END
 
#define WPAssert_NODEBUGINFO(cond, ...)   ASSERT_BEGIN do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, "", #cond, ##__VA_ARGS__); } while(0) ASSERT_END
 
#define WPFatal(cond, ...)   ASSERT_BEGIN do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); } while(0) ASSERT_END
 
#define WPError(cond, msg)   ASSERT_BEGIN do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
 
#define WPWarning(cond, msg)   ASSERT_BEGIN do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
 
#define WPAbort()   ASSERT_BEGIN do { Trinity::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END
 
#define WPAbort_MSG(msg, ...)   ASSERT_BEGIN do { Trinity::Abort(__FILE__, __LINE__, __FUNCTION__, (msg), ##__VA_ARGS__); } while(0) ASSERT_END
 
#define ASSERT   WPAssert
 
#define ASSERT_NODEBUGINFO   WPAssert_NODEBUGINFO
 
#define ASSERT_WITH_SIDE_EFFECTS   WPAssert
 
#define ABORT   WPAbort
 
#define ABORT_MSG   WPAbort_MSG
 
#define ASSERT_NOTNULL(pointer)   ASSERT_NOTNULL_IMPL(pointer, #pointer)
 

Functions

void Trinity::Assert (char const *file, int line, char const *function, std::string debugInfo, char const *message)
 
void Trinity::Assert (char const *file, int line, char const *function, std::string debugInfo, char const *message, char const *format,...)
 
void Trinity::Fatal (char const *file, int line, char const *function, char const *message,...)
 
void Trinity::Error (char const *file, int line, char const *function, char const *message)
 
void Trinity::Abort (char const *file, int line, char const *function)
 
void Trinity::Abort (char const *file, int line, char const *function, char const *message,...)
 
void Trinity::Warning (char const *file, int line, char const *function, char const *message)
 
void Trinity::AbortHandler (int sigval)
 
TC_COMMON_API std::string GetDebugInfo ()
 
template<typename T >
T * ASSERT_NOTNULL_IMPL (T *pointer, char const *expr)
 

Macro Definition Documentation

◆ ABORT

#define ABORT   WPAbort

◆ ABORT_MSG

#define ABORT_MSG   WPAbort_MSG

◆ ASSERT

#define ASSERT   WPAssert

◆ ASSERT_BEGIN

#define ASSERT_BEGIN   __pragma(warning(push)) __pragma(warning(disable: 4127))

◆ ASSERT_END

#define ASSERT_END   __pragma(warning(pop))

◆ ASSERT_NODEBUGINFO

#define ASSERT_NODEBUGINFO   WPAssert_NODEBUGINFO

◆ ASSERT_NOTNULL

#define ASSERT_NOTNULL (   pointer)    ASSERT_NOTNULL_IMPL(pointer, #pointer)

◆ ASSERT_WITH_SIDE_EFFECTS

#define ASSERT_WITH_SIDE_EFFECTS   WPAssert

◆ EXCEPTION_ASSERTION_FAILURE

#define EXCEPTION_ASSERTION_FAILURE   0xC0000420L

◆ WPAbort

#define WPAbort ( )    ASSERT_BEGIN do { Trinity::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END

◆ WPAbort_MSG

#define WPAbort_MSG (   msg,
  ... 
)    ASSERT_BEGIN do { Trinity::Abort(__FILE__, __LINE__, __FUNCTION__, (msg), ##__VA_ARGS__); } while(0) ASSERT_END

◆ WPAssert

#define WPAssert (   cond,
  ... 
)    ASSERT_BEGIN do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, GetDebugInfo(), #cond, ##__VA_ARGS__); } while(0) ASSERT_END

◆ WPAssert_NODEBUGINFO

#define WPAssert_NODEBUGINFO (   cond,
  ... 
)    ASSERT_BEGIN do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, "", #cond, ##__VA_ARGS__); } while(0) ASSERT_END

◆ WPError

#define WPError (   cond,
  msg 
)    ASSERT_BEGIN do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END

◆ WPFatal

#define WPFatal (   cond,
  ... 
)    ASSERT_BEGIN do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); } while(0) ASSERT_END

◆ WPWarning

#define WPWarning (   cond,
  msg 
)    ASSERT_BEGIN do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END

Function Documentation

◆ ASSERT_NOTNULL_IMPL()

template<typename T >
T* ASSERT_NOTNULL_IMPL ( T *  pointer,
char const *  expr 
)
inline
79 {
80  ASSERT(pointer, "%s", expr);
81  return pointer;
82 }
#define ASSERT
Definition: Errors.h:68

◆ GetDebugInfo()

TC_COMMON_API std::string GetDebugInfo ( )
158 {
159  return "";
160 }
+ Here is the caller graph for this function: