00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __MAGISUPP_H__
00026 #define __MAGISUPP_H__
00027
00028
00029 #include "magic/mconfig.h"
00030
00031
00032 #ifdef new
00033 #undef new
00034 #define new_UNDEFD
00035 #endif
00036
00037
00038
00039
00040
00041 #ifdef new_UNDEFD
00042 #define new DEBUG_NEW
00043 #undef new_UNDEFD
00044 #endif
00045
00046 #include "magic/debug.h"
00047
00048
00049 #define BEGIN_NAMESPACE(ns) namespace ns {
00050 #define END_NAMESPACE }
00051
00053
00054
00064 enum assertmodes {ASSERT_THROW=0, ASSERT_CRASH=1, ASSERT_EXIT=2, ASSERT_DONTCARE=3};
00065
00066 extern FILE* dbgout;
00067
00070 extern int assertmode;
00071
00073 extern void assertwith (const char* filename, int lineno, const char* funcname,
00074 const char* condition=NULL, const char* message=NULL);
00075
00076 #ifndef DEBUG_MODE
00077 #define NODEBUG
00078 #endif
00079
00080 #include "magic/mdebug.h"
00081
00082 #ifdef MSDOS
00083 #define IOSBINARY binary
00084 #else // UNIX
00085 #define IOSBINARY bin
00086 #endif
00087
00088
00089
00090 #define clrscr() {cout << "\033[H\033[J";}
00091
00092 #define randomize {srand (time (NULL));}
00093
00094
00095 #include "magic/mexception.h"
00096
00097 EXCEPTIONCLASS (must_overload);
00098
00099 #define MUST_OVERLOAD {assertwith (__FILE__, __LINE__, __FUNCTION__, "MUST_OVERLOAD", format("%%ERR: Method of baseclass must be overloaded by descendant %s", typeid(*this).name()));}
00100
00101 EXCEPTIONCLASS (forbidden_call);
00102 #define FORBIDDEN {throw forbidden_call (format("%%ERR: Forbidden execution at %s[%d]: %s()", __FILE__, __LINE__, __FUNCTION__));}
00103
00104 #endif
00105
00106