4 /** Defining my own assert macro */
7 #define DEBUG_ONLY(expr)
8 #define assert(expr) void(0)
10 inline void assert_fail_() {
14 #define DEBUG_ONLY(expr) expr
15 #define assert(expr) ( expr ? void(0) : assert_fail_() )
18 #define NOSPACE /* empty */
21 /** Cast that is "dynamic" (with assert) in debug mode and "static" in release mode */
22 template <class T
,class U
> inline T
debugCast(U toCast
) {
24 return static_cast<T
>(toCast
);
27 return 0; // skip the assertion
28 T result
= dynamic_cast<T
>(toCast
);
35 #define DECLARE_debugModule
37 #define DECLARE_debugModule public: \
38 virtual QWidget* debugModule(QPixmap &pixmap,const QPoint &click)
43 inline void STREAM_POS(std::istream
&file
) { pos
= file
.tellg(); }
44 inline void STREAM_POS(std::ostream
&file
) { pos
= file
.tellp(); }
46 inline void STREAM_POS(std::ios
&) {}
49 #endif // DEBUG_HEADER_