summaryrefslogtreecommitdiff
path: root/generic/Exceptions.cpp
diff options
context:
space:
mode:
authorPixel <Pixel>2002-09-27 12:17:57 +0000
committerPixel <Pixel>2002-09-27 12:17:57 +0000
commitbfa5de7eccf4604ff8217f619e9685a09e80d545 (patch)
treea5be5de750ac611145f459a09bda902c3dbc1a70 /generic/Exceptions.cpp
parent60c1003845035ad4cd0e9ea50862bad7626faf0e (diff)
The week-without-the-network changes
Diffstat (limited to 'generic/Exceptions.cpp')
-rw-r--r--generic/Exceptions.cpp20
1 files changed, 16 insertions, 4 deletions
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 <string.h>
#include <errno.h>
#include <stddef.h>
+#ifdef HAVE_GLIB
#include <glib.h>
+#endif
#ifdef DEBUG
#include <iostream>
#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));