From: Christoph Sommer Date: Sun, 9 Apr 2006 00:49:36 +0000 (+0000) Subject: Messaging system should now work X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a34cf2df8cad512e160a0b7e587e227f758e1e97;p=supertux.git Messaging system should now work SVN-Revision: 3276 --- diff --git a/src/msg.hpp b/src/msg.hpp index 731a0b35c..1622636fe 100644 --- a/src/msg.hpp +++ b/src/msg.hpp @@ -28,6 +28,8 @@ #ifdef DEBUG +namespace { + inline std::ostream& msg_debug_f(const char* file, int line) { Console::output << "[DEBUG] " << file << " l." << line << ": "; return Console::output; @@ -48,6 +50,8 @@ inline std::ostream& msg_fatal_f(const char* file, int line) { return Console::output; } +} + #define msg_debug msg_debug_f(__FILE__, __LINE__) #define msg_info msg_info_f(__FILE__, __LINE__) #define msg_warning msg_warning_f(__FILE__, __LINE__) @@ -55,28 +59,24 @@ inline std::ostream& msg_fatal_f(const char* file, int line) { #else -inline std::ostream& msg_debug_f(const char* file, int line) { - return Console::output; -} +namespace { -inline std::ostream& msg_info_f(const char* file, int line) { - return Console::output; -} - -inline std::ostream& msg_warning_f(const char* file, int line) { +inline std::ostream& msg_warning_f() { Console::output << "Warning: "; return Console::output; } -inline std::ostream& msg_fatal_f(const char* file, int line) { +inline std::ostream& msg_fatal_f() { Console::output << "Fatal: "; return Console::output; } -#define msg_debug if (0) msg_debug_f(__FILE__, __LINE__) -#define msg_info msg_info_f(__FILE__, __LINE__) -#define msg_warning msg_warning_f(__FILE__, __LINE__) -#define msg_fatal msg_fatal_f(__FILE__, __LINE__) +} + +#define msg_debug if (0) std::cerr +#define msg_info Console::output +#define msg_warning msg_warning_f() +#define msg_fatal msg_fatal_f() #endif