3 # include <utilities.h>
11 /* --- INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */
13 # define HEREWEARE {cout<<flush ; cerr << __FILE__ << " [" << __LINE__ << "] : " << flush ;}
14 # define INFOS(chain) {HEREWEARE ; cerr << chain << endl ;}
15 # define PYSCRIPT(chain) {cout<<flush ; cerr << "---PYSCRIPT--- " << chain << endl ;}
18 /* --- To print date and time of compilation of current source on stdout --- */
20 # if defined ( __GNUC__ )
21 # define COMPILER "g++" ;
22 # elif defined ( __sun )
23 # define COMPILER "CC" ;
24 # elif defined ( __KCC )
25 # define COMPILER "KCC" ;
26 # elif defined ( __PGI )
27 # define COMPILER "pgCC" ;
29 # define COMPILER "undefined" ;
32 # ifdef INFOS_COMPILATION
33 # error INFOS_COMPILATION already defined
35 # define INFOS_COMPILATION {\
38 cout << " [" << __LINE__ << "] : " ;\
39 cout << "COMPILED with " << COMPILER ;\
40 cout << ", " << __DATE__ ; \
41 cout << " at " << __TIME__ << endl ;\
48 /* --- the following MACROS are useful at debug time --- */
50 # define HERE {cout<<flush ; cerr << "- Trace " << __FILE__ << " [" << __LINE__ << "] : " << flush ;}
51 # define SCRUTE(var) {HERE ; cerr << #var << "=" << var << endl ;}
52 # define MESSAGE(chain) {HERE ; cerr << chain << endl ;}
53 # define INTERRUPTION(code) {HERE ; cerr << "INTERRUPTION return code= " << code << endl ; exit(code) ;}
56 # define ASSERT(condition) if (!(condition)){ HERE ; cerr << "CONDITION " << #condition << " NOT VERIFIED"<< endl ; INTERRUPTION(1) ;}
59 #define REPERE {cout<<flush ; cerr << " --------------" << endl << flush ;}
60 #define BEGIN_OF(chain) {REPERE ; HERE ; cerr << "Begin of: " << chain << endl ; REPERE ; }
61 #define END_OF(chain) {REPERE ; HERE ; cerr << "Normal end of: " << chain << endl ; REPERE ; }
65 # else /* ifdef _DEBUG_*/
68 # define SCRUTE(var) {}
69 # define MESSAGE(chain) {}
70 # define INTERRUPTION(code) {}
73 # define ASSERT(condition) {}
77 #define BEGIN_OF(chain) {}
78 #define END_OF(chain) {}