diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2017-02-11 11:24:52 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2017-02-11 11:24:52 -0500 |
commit | ea60f9f78bac505a5aeeb4d34b927f04ec3121b3 (patch) | |
tree | 15c617c9293c5a3b1011be0a19cb85396f49a3fc /include/error.hpp | |
parent | 27892bc40122494385bdbe5eb84aee52737f9c13 (diff) |
world bg, other fixes
Diffstat (limited to 'include/error.hpp')
-rw-r--r-- | include/error.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/error.hpp b/include/error.hpp index ef61c91..c435889 100644 --- a/include/error.hpp +++ b/include/error.hpp @@ -4,9 +4,12 @@ #include <string> #include <iostream> -inline void UserError(const std::string& why) +#define UserError(w) _UserError(__FILE__, __LINE__, w) +#define UserAssert(c, e) if (!(c)) { UserError(e); } + +inline void _UserError(const char* file, int line, const std::string& why) { - std::cout << "User error: " << why << "!\n"; + std::cout << file << ':' << line << ": error: " << why << "!\n"; abort(); } |