Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
Errors.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SKYFIRESERVER_ERRORS_H
7#define SKYFIRESERVER_ERRORS_H
8
9#include "Define.h"
10
11namespace Skyfire
12{
13
14 DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
15
16 DECLSPEC_NORETURN void Fatal(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
17
18 DECLSPEC_NORETURN void Error(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
19
20 void Warning(char const* file, int line, char const* function, char const* message);
21
22} // namespace Skyfire
23
24#define WPAssert(cond, ...) do { if (!(cond)) Skyfire::Assert(__FILE__, __LINE__, __FUNCTION__, #cond); } while (0)
25#define WPFatal(cond, msg) do { if (!(cond)) Skyfire::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
26#define WPError(cond, msg) do { if (!(cond)) Skyfire::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
27#define WPWarning(cond, msg) do { if (!(cond)) Skyfire::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
28
29#define ASSERT WPAssert
30
31#endif
#define ATTR_NORETURN
COREDEBUG.
Definition Define.h:54
#define DECLSPEC_NORETURN
Definition Define.h:36
void Assert(char const *file, int line, char const *function, char const *message)
Definition Errors.cpp:13
void Error(char const *file, int line, char const *function, char const *message)
Definition Errors.cpp:30
void Fatal(char const *file, int line, char const *function, char const *message)
Definition Errors.cpp:21
void Warning(char const *file, int line, char const *function, char const *message)
Definition Errors.cpp:38