TrinityCore
Loading...
Searching...
No Matches
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

namespace  Trinity
 
namespace  Trinity::Impl
 

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)) [[unlikely]] Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond, GetDebugInfo(), ##__VA_ARGS__); } while(0) ASSERT_END
 
#define WPAssert_NODEBUGINFO(cond, ...)   ASSERT_BEGIN do { if (!(cond)) [[unlikely]] Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond, ::GetDebugInfo(), ##__VA_ARGS__); } while(0) ASSERT_END
 
#define WPFatal(cond, ...)   ASSERT_BEGIN do { if (!(cond)) [[unlikely]] Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); } while(0) ASSERT_END
 
#define WPError(cond, msg)   ASSERT_BEGIN do { if (!(cond)) [[unlikely]] Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
 
#define WPWarning(cond, msg)   ASSERT_BEGIN do { if (!(cond)) [[unlikely]] 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_NOTNULL(pointer)   Trinity::Impl::AssertNotNull(pointer, __FILE__, __LINE__, __FUNCTION__, #pointer)
 
#define ASSERT_WITH_SIDE_EFFECTS   WPAssert
 
#define ABORT   WPAbort
 
#define ABORT_MSG   WPAbort_MSG
 

Functions

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

Macro Definition Documentation

◆ ABORT

#define ABORT   WPAbort

Definition at line 87 of file Errors.h.

◆ ABORT_MSG

#define ABORT_MSG   WPAbort_MSG

Definition at line 88 of file Errors.h.

◆ ASSERT

#define ASSERT   WPAssert

Definition at line 80 of file Errors.h.

◆ ASSERT_BEGIN

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

Definition at line 56 of file Errors.h.

◆ ASSERT_END

#define ASSERT_END   __pragma(warning(pop))

Definition at line 57 of file Errors.h.

◆ ASSERT_NODEBUGINFO

#define ASSERT_NODEBUGINFO   WPAssert_NODEBUGINFO

Definition at line 81 of file Errors.h.

◆ ASSERT_NOTNULL

#define ASSERT_NOTNULL (   pointer)    Trinity::Impl::AssertNotNull(pointer, __FILE__, __LINE__, __FUNCTION__, #pointer)

Definition at line 82 of file Errors.h.

◆ ASSERT_WITH_SIDE_EFFECTS

#define ASSERT_WITH_SIDE_EFFECTS   WPAssert

Definition at line 85 of file Errors.h.

◆ EXCEPTION_ASSERTION_FAILURE

#define EXCEPTION_ASSERTION_FAILURE   0xC0000420L

Definition at line 64 of file Errors.h.

◆ WPAbort

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

Definition at line 72 of file Errors.h.

◆ WPAbort_MSG

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

Definition at line 73 of file Errors.h.

◆ WPAssert

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

Definition at line 67 of file Errors.h.

◆ WPAssert_NODEBUGINFO

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

Definition at line 68 of file Errors.h.

◆ WPError

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

Definition at line 70 of file Errors.h.

◆ WPFatal

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

Definition at line 69 of file Errors.h.

◆ WPWarning

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

Definition at line 71 of file Errors.h.

Function Documentation

◆ GetDebugInfo()

TC_COMMON_API std::string GetDebugInfo ( )

Definition at line 170 of file Errors.cpp.

+ Here is the caller graph for this function: