]> git.saurik.com Git - wxWidgets.git/commitdiff
Remove wxDECLARE_APP() from wxIMPLEMENT_APP_NO_MAIN().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 13 May 2012 13:17:22 +0000 (13:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 13 May 2012 13:17:22 +0000 (13:17 +0000)
There is no need for a separate declaration inside wxIMPLEMENT_APP() as
wxGetApp() is defined by it and redeclaring it immediately after definition
results in a warning with some compilers/environments (Eclipse CDT).

The move of wxGetApp() to the beginning of the macro is only to ensure that a
semicolon is still required after wxIMPLEMENT_APP_NO_MAIN() and the other
macros terminating with it, such as wxIMPLEMENT_APP() itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/app.h

index 3787654e9ec639bb9d6d060380a4762ef916dd61..17b7a2c7a27b5c5e3eba5f2e80e7c69c5aff2571 100644 (file)
@@ -795,6 +795,7 @@ public:
 // Use this macro if you want to define your own main() or WinMain() function
 // and call wxEntry() from there.
 #define wxIMPLEMENT_APP_NO_MAIN(appname)                                    \
+    appname& wxGetApp() { return *static_cast<appname*>(wxApp::GetInstance()); }    \
     wxAppConsole *wxCreateApp()                                             \
     {                                                                       \
         wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE,         \
@@ -802,9 +803,7 @@ public:
         return new appname;                                                 \
     }                                                                       \
     wxAppInitializer                                                        \
-        wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp);        \
-    appname& wxGetApp() { return *static_cast<appname*>(wxApp::GetInstance()); }    \
-    wxDECLARE_APP(appname)
+        wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp)
 
 // Same as wxIMPLEMENT_APP() normally but doesn't include themes support in
 // wxUniversal builds