Go to the documentation of this file.
42 #define DEF_MSG_BUFFER std::cout
50 #define MESS_INIT(deb) std::ostringstream os; os<<deb
51 #define MESS_BEGIN(deb) MESS_INIT(deb)<<__FILE__<<" ["<<__LINE__<<"] : "
53 #define MESS_END std::endl; \
54 DEF_MSG_BUFFER << os.str() << std::endl;
56 #define MESS_ABORT std::endl; \
57 DEF_MSG_BUFFER << os.str() << std::endl;
61 #define INFOS(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
62 #define PYSCRIPT(msg) {MESS_INIT("---PYSCRIPT--- ") << msg << MESS_END}
63 #define INTERRUPTION(msg) {MESS_BEGIN("- INTERRUPTION: ")<< msg << MESS_ABORT}
65 #define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
66 std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
67 std::cerr << "ABORT return code= "<< code << std::endl; \
70 #define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
71 std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
72 std::cerr << "ABORT return code= "<< code << std::endl; \
78 #if defined ( __GNUC__ )
79 #define COMPILER "g++"
80 #elif defined ( __sun )
82 #elif defined ( __KCC )
83 #define COMPILER "KCC"
84 #elif defined ( __PGI )
85 #define COMPILER "pgCC"
86 #elif defined ( __alpha )
87 #define COMPILER "cxx"
88 #elif defined ( __BORLAND__ )
89 #define COMPILER "bcc32"
91 #define COMPILER "undefined"
94 #ifdef INFOS_COMPILATION
95 #error INFOS_COMPILATION already defined
98 #if defined(_DEBUG_) || defined (_DEBUG)
102 #define INFOS_COMPILATION { MESS_BEGIN("COMPILED with ") << COMPILER \
103 << ", " << __DATE__ \
104 << " at " << __TIME__ << MESS_END }
106 #define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
107 #define SCRUTE(var) {MESS_BEGIN("- Trace ") << #var << "=" << var <<MESS_END}
109 #define REPERE ("------- ")
110 #define BEGIN_OF(msg) {MESS_BEGIN(REPERE) << "Begin of: " << msg << MESS_END}
111 #define END_OF(msg) {MESS_BEGIN(REPERE) << "Normal end of: " << msg << MESS_END}
114 #define ASSERT(condition) \
115 if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
119 #elif !defined(_NOMSG_)
121 #define INFOS_COMPILATION
122 #define MESSAGE(msg) {MESS_BEGIN("MSG:") << msg << MESS_END}
123 #define SCRUTE(var) {MESS_BEGIN("SCRUTE:") << #var << " = " << var << MESS_END}
124 #define REPERE ("-------")
125 #define BEGIN_OF(msg) {MESS_BEGIN("MSG BEGIN:") << msg << MESS_END}
126 #define END_OF(msg) {MESS_BEGIN("MSG END:") << msg << MESS_END}
129 #define ASSERT(condition) {}
134 #define INFOS_COMPILATION
138 #define BEGIN_OF(msg)
142 #define ASSERT(condition) {}