1 // SALOME Utils : general SALOME's definitions and tools
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
25 // Author : Antoine YESSAYAN, Paul RASCLE, EDF
29 /* --- Definition macros file to print informations if _DEBUG_ is defined --- */
39 //VRV: T2.4 - replacement macro for using special CORBA server
40 #include "SALOME_Trace.hxx"
41 //VRV: T2.4 - replacement macro for using special CORBA server
43 /* --- INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */
45 //VRV: T2.4 - replacement of these macros for using special CORBA server
47 #define INFOS(msg) { GLogger.putMessage(GLogger << __FILE__<< " [" << __LINE__ << "] : " << msg<< endl << ends ); }
48 #define PYSCRIPT(msg) { GLogger.putMessage(GLogger<<"---PYSCRIPT--- "<<msg<<endl<<ends ); }
50 //# define HEREWEARE {cout<<flush ; cerr << __FILE__ << " [" << __LINE__ << "] : " << flush ;}
51 //# define INFOS(chain) {HEREWEARE ; cerr << chain << endl ;}
52 //# define PYSCRIPT(chain) {cout<<flush ; cerr << "---PYSCRIPT--- " << chain << endl ;}
54 //VRV: T2.4 - replacement of these macros for using special CORBA server
57 /* --- To print date and time of compilation of current source on stdout --- */
59 # if defined ( __GNUC__ )
60 # define COMPILER "g++"
61 # elif defined ( __sun )
62 # define COMPILER "CC"
63 # elif defined ( __KCC )
64 # define COMPILER "KCC"
65 # elif defined ( __PGI )
66 # define COMPILER "pgCC"
68 # define COMPILER "undefined"
71 # ifdef INFOS_COMPILATION
72 # error INFOS_COMPILATION already defined
75 //VRV: T2.4 - replacement macro for using special CORBA server
76 #define INFOS_COMPILATION { \
78 GLogger << __FILE__ << " [" << __LINE__ << "] : "\
79 << "COMPILED with " << COMPILER \
81 << " at " << __TIME__ << endl << endl <<endl<<ends); }
82 /* # define INFOS_COMPILATION {\ */
84 /* cout << __FILE__ ;\ */
85 /* cout << " [" << __LINE__ << "] : " ;\ */
86 /* cout << "COMPILED with " << COMPILER ;\ */
87 /* cout << ", " << __DATE__ ; \ */
88 /* cout << " at " << __TIME__ << endl ;\ */
89 /* cout << "\n\n" ;\ */
90 /* cout << flush ;\ */
92 //VRV: T2.4 - replacement macro for using special CORBA server
96 /* --- the following MACROS are useful at debug time --- */
98 //VRV: T2.4 - replacement of these macros for using special CORBA server
100 #define MYTRACE GLogger << "- Trace " << __FILE__ << " [" << __LINE__ << "] : "
102 #define MESSAGE(msg) { GLogger.putMessage( MYTRACE <<msg<<endl<<ends); }
103 #define SCRUTE(var) { GLogger.putMessage( MYTRACE << #var << "=" << var <<endl<<ends); }
105 #define REPERE GLogger << " --------------" << endl
106 #define BEGIN_OF(msg) {REPERE ; MYTRACE << "Begin of: " << msg << endl ; REPERE ; GLogger.putMessage(GLogger<<ends); }
107 #define END_OF(msg) {REPERE ; MYTRACE << "Normal end of: " << msg << endl ; REPERE ; GLogger.putMessage(GLogger<<ends); }
109 # define HERE {cout<<flush ; cerr << "- Trace " << __FILE__ << " [" << __LINE__ << "] : " << flush ;}
111 //VRV: T2.4 - replacement of these macros for using special CORBA server
113 # define INTERRUPTION(code) {HERE ; cerr << "INTERRUPTION return code= " << code << endl ; exit(code) ;}
116 # define ASSERT(condition) if (!(condition)){ HERE ; cerr << "CONDITION " << #condition << " NOT VERIFIED"<< endl ; INTERRUPTION(1) ;}
125 # else /* ifdef _DEBUG_*/
128 #define SCRUTE(var) {}
129 #define MESSAGE(msg) {}
131 #define BEGIN_OF(msg) {}
132 #define END_OF(msg) {}
134 # define INTERRUPTION(code) {}
137 # define ASSERT(condition) {}
141 # endif /* ifdef _DEBUG_*/
143 # endif /* ifndef UTILITIES_H */