]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_Utilities.hxx
Salome HOME
adding some castem mesh file to test the GIBI driver of Med Memory.
[modules/med.git] / src / MEDMEM / MEDMEM_Utilities.hxx
1 #ifdef _SALOME
2
3 #  include <utilities.h>
4
5 #else
6
7 #  include <cstdlib>
8 #  include <iostream>
9 using namespace std;
10
11 /* ---  INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */
12
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 ;}
16
17
18 /* --- To print date and time of compilation of current source on stdout --- */
19
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" ;
28 # else
29 # define COMPILER               "undefined" ;
30 # endif
31
32 # ifdef INFOS_COMPILATION
33 # error INFOS_COMPILATION already defined
34 # endif
35 # define INFOS_COMPILATION      {\
36                                         cerr << flush;\
37                                         cout << __FILE__ ;\
38                                         cout << " [" << __LINE__ << "] : " ;\
39                                         cout << "COMPILED with " << COMPILER ;\
40                                         cout << ", " << __DATE__ ; \
41                                         cout << " at " << __TIME__ << endl ;\
42                                         cout << "\n\n" ;\
43                                         cout << flush ;\
44                                 }
45
46 # ifdef _DEBUG_
47
48 /* --- the following MACROS are useful at debug time --- */
49
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) ;}
54
55 # ifndef ASSERT
56 # define ASSERT(condition) if (!(condition)){ HERE ; cerr << "CONDITION " << #condition << " NOT VERIFIED"<< endl ; INTERRUPTION(1) ;}
57 # endif /* ASSERT */
58
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 ; }
62
63
64
65 # else /* ifdef _DEBUG_*/
66
67 # define HERE
68 # define SCRUTE(var) {}
69 # define MESSAGE(chain) {}
70 # define INTERRUPTION(code) {}
71
72 # ifndef ASSERT
73 # define ASSERT(condition) {}
74 # endif /* ASSERT */
75
76 #define REPERE
77 #define BEGIN_OF(chain) {}
78 #define END_OF(chain) {}
79
80 #endif
81