DDNet documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
dbg.h
Go to the documentation of this file.
1
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2
/* If you are missing that file, acquire a complete release at teeworlds.com. */
3
4
#ifndef BASE_DBG_H
5
#define BASE_DBG_H
6
7
#include <functional>
8
14
27
#define dbg_assert(test, fmt, ...) \
28
do \
29
{ \
30
if(!(test)) [[unlikely]] \
31
{ \
32
dbg_assert_imp(__FILE__, __LINE__, fmt, ##__VA_ARGS__); \
33
} \
34
} while(false)
35
47
#define dbg_assert_failed(fmt, ...) [[unlikely]] dbg_assert_imp(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
48
59
extern
"C"
[[gnu::format(printf, 3, 4)]] [[noreturn]]
void
60
dbg_assert_imp
(
const
char
*filename,
int
line,
const
char
*fmt, ...);
61
73
bool
dbg_assert_has_failed
();
74
84
[[noreturn]]
void
dbg_break
();
85
95
typedef
std::function<void(
const
char
*message)>
DBG_ASSERT_HANDLER
;
96
107
void
dbg_assert_set_handler
(
DBG_ASSERT_HANDLER
handler);
108
121
[[gnu::format(printf, 2, 3)]]
void
dbg_msg
(
const
char
*sys,
const
char
*fmt, ...);
122
123
#endif
dbg_assert_imp
void dbg_assert_imp(const char *filename, int line, const char *fmt,...)
Definition
dbg.cpp:21
dbg_break
void dbg_break()
Definition
dbg.cpp:43
dbg_assert_set_handler
void dbg_assert_set_handler(DBG_ASSERT_HANDLER handler)
Definition
dbg.cpp:52
DBG_ASSERT_HANDLER
std::function< void(const char *message)> DBG_ASSERT_HANDLER
Definition
dbg.h:95
dbg_assert_has_failed
bool dbg_assert_has_failed()
Definition
dbg.cpp:16
dbg_msg
void dbg_msg(const char *sys, const char *fmt,...)
Definition
dbg.cpp:57
src
base
dbg.h
Generated by
1.18.0