///////////////////////////////////////////////////////////////////////////// // Name: debug.h // tag: A header file defining some debug macros // Author: David Roundy // Modified by: // Created: 10/2001 // Copyright: (c) 2001 David Roundy // Licence: GPL /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ///////////////////////////////////////////////////////////////////////////// #ifndef _DEBUG_H_ #define _DEBUG_H_ #define DEBUG 1 #include #include inline void ImportantDebugMsg(const wxString& msg) { #if DEBUG #ifdef __WXMSW__ wxMessageDialog *dlg = new wxMessageDialog(NULL, msg, "Debug", wxOK); dlg->ShowModal(); delete dlg; // wxLogWarning(msg); printf("ImportantDebug: %s\n", msg.c_str()); #endif #ifdef __WXMAC__ printf("ImportantDebug: %s\n", msg.c_str()); //wxMessageBox(msg, "Debug"); #endif #ifdef __WXGTK__ printf("ImportantDebug: %s\n", msg.c_str()); #endif #endif } inline void DebugMsg(const wxString& msg) { #if DEBUG #ifdef __WXMSW__ //wxMessageDialog *dlg = new wxMessageDialog(NULL, msg, "Debug", wxOK); //dlg->ShowModal(); //delete dlg; // wxLogWarning(msg); #endif #ifdef __WXMAC__ //wxMessageBox(msg, "Debug"); printf("Debug: %s\n", msg.c_str()); //wxLogWarning(msg); #endif #ifdef __WXGTK__ printf("Debug: %s\n", msg.c_str()); #endif #ifdef __WXMSW__ fprintf(stderr, "Debug: %s\n", msg.c_str()); #endif #endif } inline void DebugInfo(const wxString& msg) { #if DEBUG #ifdef __WXMSW__ wxMessageDialog *dlg = new wxMessageDialog(NULL, msg, "Info", wxOK); dlg->ShowModal(); delete dlg; #endif #ifdef __WXGTK__ printf("Info: %s\n", msg.c_str()); #endif #endif } inline void NoDebugMsg(const wxString& msg) { } #endif