summaryrefslogtreecommitdiff
path: root/lib/Exceptions.cc
diff options
context:
space:
mode:
authorpixel <pixel>2003-03-09 17:52:22 +0000
committerpixel <pixel>2003-03-09 17:52:22 +0000
commit07d61956b593e6bc973db3fa699db22a36a35dbc (patch)
tree3639bcb03beed74ede144a1d24542cef85c913f7 /lib/Exceptions.cc
parentb62700e5dfd6b24f33e645c3ae0780777c610bf6 (diff)
Fixing mingw...
Diffstat (limited to 'lib/Exceptions.cc')
-rw-r--r--lib/Exceptions.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc
index 43b77f1..9ffa572 100644
--- a/lib/Exceptions.cc
+++ b/lib/Exceptions.cc
@@ -23,17 +23,17 @@ char GeneralException::t[BUFSIZ];
GeneralException::GeneralException(String emsg) : msg(emsg.strdup()) {
#ifdef DEBUG
- std::cerr << _("Generating a General Exception error: '") << msg << "'.\n";
+ printm(M_BARE, String(_("Generating a General Exception error: '")) + msg + "'.\n");
#endif
}
GeneralException::GeneralException() : msg(0) {
#ifdef DEBUG
- std::cerr << _("Generating a General Exception error: '") << msg << "'.\n";
+ printm(M_BARE, String(_("Generating a General Exception error: '")) + msg + "'.\n");
#endif
}
GeneralException::GeneralException(const GeneralException & e) : msg(strdup(e.msg)) {
#ifdef DEBUG
- std::cerr << _("Generating a General Exception error: '") << msg << "'.\n";
+ printm(M_BARE, String(_("Generating a General Exception error: '")) + msg + "'.\n");
#endif
}
@@ -41,7 +41,7 @@ GeneralException::~GeneralException() {
free(msg);
}
-TaskNotFound::TaskNotFound() : GeneralException("Task not found") { }
+TaskNotFound::TaskNotFound() : GeneralException(_("Task not found")) { }
const char * GeneralException::GetMsg() const {
return msg;
@@ -64,19 +64,19 @@ IOGeneral::IOGeneral() { }
IOAgain::IOAgain() : IOGeneral(_("No more bytes for reading or writing.")) {
#ifdef DEBUG
- std::cerr << "Generating an IOAgain exception: '" << GetMsg() << "'.\n";
+ printm(M_BARE, String(_("Generating an IOAgain exception: '")) + GetMsg() + "'.\n");
#endif
}
TaskSwitch::TaskSwitch() : GeneralException(_("Switching task in a non-tasked environnement")) {
#ifdef DEBUG
- std::cerr << "Generating a TaskSwitch exception: '" << GetMsg() << "'.\n";
+ printm(M_BARE, String(_("Generating a TaskSwitch exception: '")) + GetMsg() + "'.\n");
#endif
}
Exit::Exit(int a_code) : GeneralException(_("Exitting with code " + a_code)), code(a_code) {
#ifdef DEBUG
- std::cerr << "Generating an Exit exception: '" << GetMsg() << "'.\n";
+ printm(M_BARE, String(_("Generating an Exit exception: '")) + GetMsg() + "'.\n");
#endif
}
@@ -103,7 +103,7 @@ void * xmalloc(size_t s) throw (GeneralException) {
throw MemoryException(s);
}
#ifdef DEBUG
- fprintf(stderr, "Allocating %i bytes of memory, got it at %p\n", s, r);
+ Base::printm(M_BARE, String(_("Allocating %i bytes of memory, got it at %p\n")), s, r);
#endif
memset(r, 0, s);
@@ -114,7 +114,7 @@ void * xmalloc(size_t s) throw (GeneralException) {
void * xrealloc(void * ptr, size_t s) {
#ifdef DEBUG
void * r = realloc(ptr, s);
- fprintf(stderr, "Reallocating pointer at %p for %i bytes, now at %p\n", ptr, s, r);
+ Base::printm(M_BARE, String(_("Reallocating pointer at %p for %i bytes, now at %p\n")), ptr, s, r);
return r;
#else
return realloc(ptr, s);
@@ -135,7 +135,7 @@ void xfree(void *& p) {
void xfree(char *& p) {
#ifdef DEBUG
- fprintf(stderr, "Freeing pointer at %p\n", p);
+ Base::printm(M_BARE, String(_("Freeing pointer at %p\n")), p);
#endif
if (p) {
::free(p);
@@ -197,21 +197,21 @@ void * Base::calloc(size_t n, size_t s) {
void * Base::operator new(size_t s) {
#ifdef DEBUG
- std::cerr << "Operator new(s) called. Allocating memory.\n";
+ std::cerr << _("Operator new(s) called. Allocating memory.\n");
#endif
return xmalloc(s);
}
void * Base::operator new(size_t s, void * p) {
#ifdef DEBUG
- printm(M_BARE, "Operator new(s, p) called with p = %p and s = %i. Erasing memory.\n", p, s);
+ printm(M_BARE, String(_("Operator new(s, p) called with p = %p and s = %i. Erasing memory.\n")), p, s);
#endif
return memset(p, 0, s);
}
void Base::operator delete(void * p) {
#ifdef DEBUG
- printm(M_BARE, "Operator delete(p) called. Freeing memory.\n");
+ printm(M_BARE, _("Operator delete(p) called. Freeing memory.\n"));
#endif
xfree(p);
}