DDraceNetwork Documentation
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)) \
31 { \
32 dbg_assert_imp(__FILE__, __LINE__, fmt, ##__VA_ARGS__); \
33 } \
34 } while(false)
35
47#define dbg_assert_failed(fmt, ...) dbg_assert_imp(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
48
56[[gnu::format(printf, 3, 4)]] [[noreturn]] void
57dbg_assert_imp(const char *filename, int line, const char *fmt, ...);
58
71
81[[noreturn]] void dbg_break();
82
92typedef std::function<void(const char *message)> DBG_ASSERT_HANDLER;
93
105
118[[gnu::format(printf, 2, 3)]] void dbg_msg(const char *sys, const char *fmt, ...);
119
120#endif
void dbg_assert_imp(const char *filename, int line, const char *fmt,...)
Definition dbg.cpp:21
void dbg_break()
Definition dbg.cpp:43
void dbg_assert_set_handler(DBG_ASSERT_HANDLER handler)
Definition dbg.cpp:52
std::function< void(const char *message)> DBG_ASSERT_HANDLER
Definition dbg.h:92
bool dbg_assert_has_failed()
Definition dbg.cpp:16
void dbg_msg(const char *sys, const char *fmt,...)
Definition dbg.cpp:57