]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_Utilities.hxx
Salome HOME
update after merging trhe branches CEA_V3_0_x, OCC_V3_1_0_a1_x, and the main
[modules/med.git] / src / MEDMEM / MEDMEM_Utilities.hxx
1 #ifndef __MEDMEM_UTILITIES\r
2 #define __MEDMEM_UTILITIES\r
3 \r
4 #ifdef MED_WITH_KERNEL\r
5 // #ifdef _SALOME\r
6 \r
7 #  include <utilities.h>\r
8 \r
9 #else\r
10 \r
11 #  include <cstdlib>\r
12 #  include <iostream>\r
13 using namespace std;\r
14 \r
15 /* ---  INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */\r
16 \r
17 # define HEREWEARE {cout<<flush ; cerr << __FILE__ << " [" << __LINE__ << "] : " << flush ;}\r
18 # define INFOS(chain) {HEREWEARE ; cerr << chain << endl ;}\r
19 # define PYSCRIPT(chain) {cout<<flush ; cerr << "---PYSCRIPT--- " << chain << endl ;}\r
20 \r
21 \r
22 /* --- To print date and time of compilation of current source on stdout --- */\r
23 \r
24 # if defined ( __GNUC__ )\r
25 # define COMPILER               "g++" ;\r
26 # elif defined ( __sun )\r
27 # define COMPILER               "CC" ;\r
28 # elif defined ( __KCC )\r
29 # define COMPILER               "KCC" ;\r
30 # elif defined ( __PGI )\r
31 # define COMPILER               "pgCC" ;\r
32 # else\r
33 # define COMPILER               "undefined" ;\r
34 # endif\r
35 \r
36 # ifdef INFOS_COMPILATION\r
37 # undef INFOS_COMPILATION\r
38 # endif\r
39 # define INFOS_COMPILATION      {\\r
40                                         cerr << flush;\\r
41                                         cout << __FILE__ ;\\r
42                                         cout << " [" << __LINE__ << "] : " ;\\r
43                                         cout << "COMPILED with " << COMPILER ;\\r
44                                         cout << ", " << __DATE__ ; \\r
45                                         cout << " at " << __TIME__ << endl ;\\r
46                                         cout << "\n\n" ;\\r
47                                         cout << flush ;\\r
48                                 }\r
49 \r
50 # ifdef _DEBUG_\r
51 \r
52 /* --- the following MACROS are useful at debug time --- */\r
53 \r
54 # define HERE {cout<<flush ; cerr << "- Trace " << __FILE__ << " [" << __LINE__ << "] : " << flush ;}\r
55 # define SCRUTE(var) {HERE ; cerr << #var << "=" << var << endl ;}\r
56 # define MESSAGE(chain) {HERE ; cerr << chain << endl ;}\r
57 # define INTERRUPTION(code) {HERE ; cerr << "INTERRUPTION return code= " << code << endl ; exit(code) ;}\r
58 \r
59 # ifndef ASSERT\r
60 # define ASSERT(condition) if (!(condition)){ HERE ; cerr << "CONDITION " << #condition << " NOT VERIFIED"<< endl ; INTERRUPTION(1) ;}\r
61 # endif /* ASSERT */\r
62 \r
63 #define REPERE {cout<<flush ; cerr << "   --------------" << endl << flush ;}\r
64 #define BEGIN_OF(chain) {REPERE ; HERE ; cerr << "Begin of: " << chain << endl ; REPERE ; }\r
65 #define END_OF(chain) {REPERE ; HERE ; cerr << "Normal end of: " << chain << endl ; REPERE ; }\r
66 \r
67 \r
68 \r
69 # else /* ifdef _DEBUG_*/\r
70 \r
71 # define HERE\r
72 # define SCRUTE(var) {}\r
73 # define MESSAGE(chain) {}\r
74 # define INTERRUPTION(code) {}\r
75 \r
76 # ifndef ASSERT\r
77 # define ASSERT(condition) {}\r
78 # endif /* ASSERT */\r
79 \r
80 #define REPERE\r
81 #define BEGIN_OF(chain) {}\r
82 #define END_OF(chain) {}\r
83 \r
84 #endif\r
85 \r
86 #endif\r
87 #endif\r