#include class whinage:public std::exception { std::string m_what; public: whinage(std::string str):m_what(str){} ~whinage() throw() {} const char *what() const throw() {return m_what.c_str();} }; //Whining outputs text first, then throws an exception as well //(because this pretty much guarantees getting the text off before we crash :/ ) void whine(char *file, int line, const std::string &); void dbg_log(char *file, int line, const std::string &); #define DBG_WHINE(w) whine(__FILE__, __LINE__, w); #define DBG_LOG(w) dbg_log(__FILE__, __LINE__, w);