#ifndef __APPH_BASE__
#define __APPH_BASE__
-/*
+#ifdef __WXMSW__
class WXDLLEXPORT wxApp;
typedef wxApp* (*wxAppInitializerFunction) (void);
-*/
+#endif
#include "wx/object.h"
+#ifndef __WXMSW__
typedef wxObject* (*wxAppInitializerFunction) (void); // returning wxApp* won't work with gcc
+#endif
-#if defined(__WINDOWS__)
+#if defined(__WXMSW__)
#include "wx/msw/app.h"
-#elif defined(__MOTIF__)
+#elif defined(__WXMOTIF__)
#include "wx/xt/app.h"
-#elif defined(__GTK__)
+#elif defined(__WXQT__)
+#include "wx/qt/app.h"
+#elif defined(__WXGTK__)
#include "wx/gtk/app.h"
#endif
}
};
+// Here's a macro you can use if your compiler
+// really, really wants main() to be in your main program
+// (e.g. hello.cpp).
+// Now IMPLEMENT_APP should add this code if required.
+
+#if defined(__AIX__) || defined(__HPUX__)
+#define IMPLEMENT_WXWIN_MAIN \
+extern int wxEntry( int argc, char *argv[] ); \
+int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
+#else
+#define IMPLEMENT_WXWIN_MAIN
+#endif
+
#define IMPLEMENT_APP(appname) \
wxApp *wxCreateApp(void) { return new appname; } \
wxAppInitializer wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
appname& wxGetApp(void) { return *(appname *)wxTheApp; } \
-\
- extern int wxEntry( int argc, char *argv[] ); \
- int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
-
+ IMPLEMENT_WXWIN_MAIN
#define DECLARE_APP(appname) \
extern appname& wxGetApp(void) ;