00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _OPENCITY_MACROS_H_
00020 #define _OPENCITY_MACROS_H_ 1
00021
00022 #include <iostream>
00023 #include <cassert>
00024 using std::cout;
00025 using std::endl;
00026 using std::cerr;
00027
00028
00029 #ifndef NDEBUG
00030 #define OPENCITY_DEBUG( msg ) { \
00031 cout << "<DEBUG> " << __FILE__ << " " << __LINE__ << " : " << msg << endl; \
00032 }
00033 #else
00034 #define OPENCITY_DEBUG(msg)
00035 #endif
00036
00037
00038 #define OPENCITY_INFO( msg ) { \
00039 cout << "<INFO> " << msg << endl; \
00040 }
00041
00042
00043 #define OPENCITY_ERROR( msg ) { \
00044 cout << "<ERROR> " << msg << endl; \
00045 }
00046
00047
00048 #define OPENCITY_FATAL( msg ) { \
00049 cerr << "<FATAL> " << msg << endl; \
00050 }
00051
00052
00053 #define OPENCITY_SWAP( a, b, type ) \
00054 {\
00055 if (a > b) { \
00056 type c;\
00057 c = a; a = b; b = c;\
00058 }\
00059 }
00060
00061
00062 #ifndef uint
00063 typedef unsigned int uint;
00064 #endif
00065
00066
00067 #endif
00068