UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
debug.hpp
Go to the documentation of this file.
1#ifndef DEBUG_HPP_db8549e3cb58
2#define DEBUG_HPP_db8549e3cb58
3
4#include <cassert>
5#include <QMessageBox>
6#include <stdlib.h>
7
8#define ASSERT_GUI(x) if(!(x)) abort_msgBox("Assert failed: " #x)
9
10#ifdef DEBUG
11# define DEBUG_ASSERT(x) assert(x)
12# define DEBUG_ASSERT_GUI(x) ASSERT_GUI(x)
13#else
14# define DEBUG_ASSERT(x) do{ }while(0)
15# define DEBUG_ASSERT_GUI(x) do{ }while(0)
16#endif
17
18#define DEBUG_FAIL(x) DEBUG_ASSERT((x) && false)
19
20static inline void abort_msgBox(const char *msg){
21 QMessageBox msgBox;
22 msgBox.setText(msg);
23 msgBox.setIcon(QMessageBox::Critical);
24 msgBox.exec();
25 exit(EXIT_FAILURE);
26}
27
28#endif //DEBUG_HPP_db8549e3cb58
static void abort_msgBox(const char *msg)
Definition debug.hpp:20