X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c801d85f158c4cba50b588807daabdcbd0ed3853..6a06dd8df2db19e3e646f2d3c8f696168e98f846:/include/wx/app.h?ds=sidebyside diff --git a/include/wx/app.h b/include/wx/app.h index 0a6bccac70..8d11a5aeb4 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -12,14 +12,16 @@ #ifndef __APPH_BASE__ #define __APPH_BASE__ -/* +#ifndef __GTK__ class WXDLLEXPORT wxApp; typedef wxApp* (*wxAppInitializerFunction) (void); -*/ +#endif #include "wx/object.h" +#ifdef __GTK__ typedef wxObject* (*wxAppInitializerFunction) (void); // returning wxApp* won't work with gcc +#endif #if defined(__WINDOWS__) #include "wx/msw/app.h" @@ -44,14 +46,22 @@ 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(AIX4) /* || defined(____HPUX__) */ +#define IMPLEMENT_WXWIN_MAIN 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) ;