diff options
| -rw-r--r-- | include/Main.h | 5 | ||||
| -rw-r--r-- | lib/Exceptions.cc | 26 | ||||
| -rw-r--r-- | lib/Input.cc | 1 | ||||
| -rw-r--r-- | lib/Makefile.sol.mingw | 2 | 
4 files changed, 18 insertions, 16 deletions
| diff --git a/include/Main.h b/include/Main.h index 4c71c4e..6d4ac9c 100644 --- a/include/Main.h +++ b/include/Main.h @@ -22,12 +22,13 @@ class Main : public Base {  };  #define CODE_BEGINS class Appli : public Main { -#define CODE_ENDS }; extern "C" {int main(int argc, char ** argv) { \ +#define CODE_ENDS }; \ +int main(int argc, char ** argv) { \      int r; \      Appli * Application = new Appli(); \      r = Main::truemain(Application, argc, argv, environ); \      delete Application; \      return r; \ -} } +}  #endif 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);  } diff --git a/lib/Input.cc b/lib/Input.cc index 9697913..e92f74d 100644 --- a/lib/Input.cc +++ b/lib/Input.cc @@ -419,3 +419,4 @@ Archive::FileTree * Archive::FileTree::Next() {  Archive::FileTree * Archive::FileTree::Prev() {      return prev;  } +>>>>>>> 1.24 diff --git a/lib/Makefile.sol.mingw b/lib/Makefile.sol.mingw index 8a1366d..d4685e5 100644 --- a/lib/Makefile.sol.mingw +++ b/lib/Makefile.sol.mingw @@ -2,7 +2,7 @@ CC = i586-mingw32msvc-gcc  CXX = i586-mingw32msvc-g++  AR = i586-mingw32msvc-ar  RANLIB = i586-mingw32msvc-ranlib -CPPFLAGS = -I../include -DFORCE64 -I/usr/local/win32/include -I../../extra/regex +CPPFLAGS = -I../include -DFORCE64 -O3 -mwindows -D_REENTRANT -I/usr/local/win32/include -I../../extra/regex  OBJECTS = Buffer.o Exceptions.o Handle.o Image.o Input.o Main.o Output.o \    Regex.o String.o checkargs.o datecalc.o fileutils.o generic.o  TARGET = Baltisot-sol.a | 
