Go to the documentation of this file.
39 #define DEF_MSG_BUFFER std::cout
47 #define MESS_INIT(deb) std::ostringstream os; os<<deb
48 #define MESS_BEGIN(deb) MESS_INIT(deb)<<__FILE__<<" ["<<__LINE__<<"] : "
50 #define MESS_END std::endl; \
51 DEF_MSG_BUFFER << os.str() << std::endl;
53 #define MESS_ABORT std::endl; \
54 DEF_MSG_BUFFER << os.str() << std::endl;
58 #define INFOS(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
59 #define PYSCRIPT(msg) {MESS_INIT("---PYSCRIPT--- ") << msg << MESS_END}
60 #define INTERRUPTION(msg) {MESS_BEGIN("- INTERRUPTION: ")<< msg << MESS_ABORT}
62 #define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
63 std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
64 std::cerr << "ABORT return code= "<< code << std::endl; \
67 #define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
68 std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
69 std::cerr << "ABORT return code= "<< code << std::endl; \
75 #if defined ( __GNUC__ )
76 #define COMPILER "g++"
77 #elif defined ( __sun )
79 #elif defined ( __KCC )
80 #define COMPILER "KCC"
81 #elif defined ( __PGI )
82 #define COMPILER "pgCC"
83 #elif defined ( __alpha )
84 #define COMPILER "cxx"
85 #elif defined ( __BORLAND__ )
86 #define COMPILER "bcc32"
88 #define COMPILER "undefined"
91 #ifdef INFOS_COMPILATION
92 #error INFOS_COMPILATION already defined
95 #if defined(_DEBUG_) || defined (_DEBUG)
99 #define INFOS_COMPILATION { MESS_BEGIN("COMPILED with ") << COMPILER \
100 << ", " << __DATE__ \
101 << " at " << __TIME__ << MESS_END }
103 #define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
104 #define SCRUTE(var) {MESS_BEGIN("- Trace ") << #var << "=" << var <<MESS_END}
106 #define REPERE ("------- ")
107 #define BEGIN_OF(msg) {MESS_BEGIN(REPERE) << "Begin of: " << msg << MESS_END}
108 #define END_OF(msg) {MESS_BEGIN(REPERE) << "Normal end of: " << msg << MESS_END}
111 #define ASSERT(condition) \
112 if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
116 #elif !defined(_NOMSG_)
118 #define INFOS_COMPILATION
119 #define MESSAGE(msg) {MESS_BEGIN("MSG:") << msg << MESS_END}
120 #define SCRUTE(var) {MESS_BEGIN("SCRUTE:") << #var << " = " << var << MESS_END}
121 #define REPERE ("-------")
122 #define BEGIN_OF(msg) {MESS_BEGIN("MSG BEGIN:") << msg << MESS_END}
123 #define END_OF(msg) {MESS_BEGIN("MSG END:") << msg << MESS_END}
126 #define ASSERT(condition) {}
131 #define INFOS_COMPILATION
135 #define BEGIN_OF(msg)
139 #define ASSERT(condition) {}