--- a/src/common.h Thu Jun 13 16:33:17 2013 +0300 +++ b/src/common.h Fri Jun 14 16:00:54 2013 +0300 @@ -59,6 +59,10 @@ # define devf(...) #endif // RELEASE +class QFile; +extern QFile g_file_stdout; +extern QFile g_file_stderr; + void doDevf (const char* func, const char* fmtstr, ...); // Version string identifier @@ -139,6 +143,17 @@ #define FUNCNAME __func__ #endif // __GNUC__ +// printf replacement +#ifndef IN_IDE_PARSER +#define print(...) doPrint (g_file_stdout, {__VA_ARGS__}) +#define fprint(F, ...) doPrint (F, {__VA_ARGS__}) +#else +void print (const char* fmtstr, ...); +void fprint (QFile& f, const char* fmtstr, ...); +#endif +void doPrint (QFile& f, initlist<StringFormatArg> args); +void doPrint (FILE* f, initlist<StringFormatArg> args); + // Replace assert with a version that shows a GUI dialog if possible #ifdef assert #undef assert