4 /** Defining my own ASSERT macro */
6 #define DEBUG_ONLY(expr)
7 #define ASSERT(expr) void(0)
9 inline void assert_fail_() {
13 #define DEBUG_ONLY(expr) expr
14 #define ASSERT(expr) ( (expr) ? void(0) : assert_fail_() )
17 #define NOSPACE /* empty */
20 /** Cast that is "dynamic" (with ASSERT) in debug mode and "static" in release mode */
21 template <class T
,class U
> inline T
debugCast(U toCast
) {
23 return static_cast<T
>(toCast
);
26 return 0; // skip the assertion
27 T result
= dynamic_cast<T
>(toCast
);
34 #define DECLARE_debugModule
35 #define DECLARE_debugModule_empty
37 #define DECLARE_debugModule public: \
38 virtual QWidget* debugModule(QPixmap &pixmap,const QPoint &click)
39 #define DECLARE_debugModule_empty public: \
40 virtual QWidget* debugModule(QPixmap &,const QPoint &) { return 0; }
45 inline void STREAM_POS(std::istream
&file
) { pos
= file
.tellg(); }
46 inline void STREAM_POS(std::ostream
&file
) { pos
= file
.tellp(); }
48 inline void STREAM_POS(std::ios
&) {}
52 #endif // DEBUG_HEADER_