-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathError.hpp
More file actions
33 lines (26 loc) · 751 Bytes
/
Copy pathError.hpp
File metadata and controls
33 lines (26 loc) · 751 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
26
27
28
29
30
31
32
33
#ifndef SoftWire_Error_hpp
#define SoftWire_Error_hpp
namespace SoftWire
{
class Error
{
public:
Error(const char *format, ...);
const char *getString() const;
Error &operator<<(const Error &error);
Error &operator>>(const Error &error);
private:
char string[256];
};
#ifndef __FUNCSIG__
#define __FUNCSIG__ "<function signature unavailable>"
#endif
#ifndef NDEBUG
#define INTERNAL_ERROR Error("%s(%d):\n\tInternal error in '%s'", __FILE__, __LINE__, __FUNCSIG__)
#define EXCEPTION Error("%s(%d):\n\t", __FILE__, __LINE__) << Error
#else
#define INTERNAL_ERROR Error("Internal error in '%s'", __FUNCSIG__)
#define EXCEPTION Error
#endif
}
#endif // SoftWire_Error_hpp