// // Error Handling & Tracing // #ifndef DEBUG #define DEBUG_ALERT(x) #define ALERT(x) alert(x) #define ERROR_STRING(x, e) x #else #define DEBUG_ALERT(x) alert("File: " + __FILE__ + "\nLine: " + __LINE__ + "\n" + x) #define ALERT(x) DEBUG_ALERT(x) #define ERROR_STRING(x, er) ("\nFile:\t"+__FILE__+"\nLine:\t"+__LINE__+"\n"+x+"\n"+("string"==typeof(er)?er:"\nDesc:\t" + er.description + "\nNo:\t" + er.number)) #endif #ifdef DEBUG #define InitTrace() InitTraceEx( __FILE__ ) #else #define InitTrace() #endif #ifndef DEBUG #include "debug_decl.inc" #else #include "constants.inc" #endif