From bfa5de7eccf4604ff8217f619e9685a09e80d545 Mon Sep 17 00:00:00 2001 From: Pixel Date: Fri, 27 Sep 2002 12:17:57 +0000 Subject: The week-without-the-network changes --- generic/Exceptions.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'generic/Exceptions.cpp') diff --git a/generic/Exceptions.cpp b/generic/Exceptions.cpp index b7c00a6..510e0a3 100644 --- a/generic/Exceptions.cpp +++ b/generic/Exceptions.cpp @@ -3,7 +3,9 @@ #include #include #include +#ifdef HAVE_GLIB #include +#endif #ifdef DEBUG #include #endif @@ -40,7 +42,7 @@ GeneralException::~GeneralException() { TaskNotFound::TaskNotFound() : GeneralException("Task not found") { } -char * GeneralException::GetMsg() { +const char * GeneralException::GetMsg() const { return msg; } @@ -71,6 +73,16 @@ TaskSwitch::TaskSwitch() : GeneralException(_("Switching task in a non-tasked en #endif } +Exit::Exit(int a_code) : GeneralException(_("Exitting with code " + a_code)), code(a_code) { +#ifdef DEBUG + cerr << "Generating an Exit exception: '" << GetMsg() << "'.\n"; +#endif +} + +int Exit::GetCode() { + return code; +} + char * xstrdup(const char * s) { char * r; @@ -108,9 +120,9 @@ void * xrealloc(void * ptr, size_t s) { #endif } -#ifdef OVER_FREE -#undef free -#endif +void xfree(unsigned char *& p) { + xfree(((char *)p)); +} void xfree(void *& p) { xfree(((char *)p)); -- cgit v1.2.3