X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/10b959e3729a77b95ab15614d1bdce74da327d8b..b5f2afe5412f25a334d88bbeadaa4c346edf08c2:/include/wx/app.h diff --git a/include/wx/app.h b/include/wx/app.h index 043856718e..349bac1acf 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -19,7 +19,7 @@ typedef wxApp* (*wxAppInitializerFunction) (void); #include "wx/object.h" -#ifdef __GTK +#ifdef __GTK__ typedef wxObject* (*wxAppInitializerFunction) (void); // returning wxApp* won't work with gcc #endif @@ -46,14 +46,24 @@ public: } }; +// 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(__SUN__) || 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) ;