]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wxMotif compilation with g++ 4.4.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Jul 2010 11:33:09 +0000 (11:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Jul 2010 11:33:09 +0000 (11:33 +0000)
wxMenu::CreateMenu() parameter called "index" was mistakenly wrapped in
WXUNUSED() making it invisible inside the function body and the (BSD string
function) index() was used instead. This somehow compiled before but not with
g++ 4.4. In any case, the code was wrong even when it did compile.

Remove WXUNUSED() from the parameter and also rename it to avoid clashes with
(semi-)standard function which can also be defined as macro on some systems.

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

src/motif/menu.cpp

index 65fcead0535129cab59a7534c5baa79f6ec551c8..5f30a9549644ae55a303bc5d6fe7841b631092e3 100644 (file)
@@ -446,7 +446,7 @@ void wxMenu::DestroyWidgetAndDetach()
 WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar,
                              WXWidget parent,
                              wxMenu * topMenu,
-                             size_t WXUNUSED(index),
+                             size_t menuIndex,
                              const wxString& title,
                              bool pullDown)
 {
@@ -493,7 +493,7 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar,
             XmNlabelString, label_str(),
             XmNsubMenuId, menu,
             (String)wxFont::GetFontTag(), m_font.GetFontTypeC(dpy),
-            XmNpositionIndex, index,
+            XmNpositionIndex, menuIndex,
             NULL);
 
         if (mnem != 0)