-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexit.h
More file actions
25 lines (18 loc) · 741 Bytes
/
exit.h
File metadata and controls
25 lines (18 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef GODEFV_ERROR_CHECKING_EXIT_H
#define GODEFV_ERROR_CHECKING_EXIT_H
#include<string>
#ifdef _MSC_VER
#define NORETURN __declspec(noreturn)
#else
#define NORETURN [[noreturn]]
#endif
namespace godefv{
//! If true (default), calling godefv::exit will open a popup window displaying the error message.
//! In this case, the calling process terminates only when the user closes this popup window.
extern bool error_checking_exit_has_popup;
//! Exits the calling process, displaying given message and last os error.
NORETURN void exit(std::string const& msg) noexcept;
void exit_if_false(bool condition, std::string const& msg);
void exit_if_true (bool condition, std::string const& msg);
}
#endif /* GODEFV_ERROR_CHECKING_EXIT_H */