From 21b37aa88eea862e4125fc01b61a2450531748af Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 17 Aug 2020 02:01:11 +0200 Subject: [PATCH] Add ctor to wxArtStockMapping to fix C++98 build Can't use aggregate initialization without C++11. --- src/gtk/artgtk.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gtk/artgtk.cpp b/src/gtk/artgtk.cpp index 95346e914e..ecaa9c1e48 100644 --- a/src/gtk/artgtk.cpp +++ b/src/gtk/artgtk.cpp @@ -56,14 +56,19 @@ wxString wxArtIDToStock(const wxArtID& id) { struct wxArtStockMapping { - wxArtID artId; - wxString stockId; + wxArtStockMapping(const wxArtID& artId, const wxString& stockId) + : m_artId(artId), m_stockId(stockId) + { + } + + wxArtID m_artId; + wxString m_stockId; }; #ifdef __WXGTK3__ - #define ART(wxId, unused, themeId) wxArtStockMapping{wxId, themeId}, + #define ART(wxId, unused, themeId) wxArtStockMapping(wxId, themeId), #else - #define ART(wxId, stockId, unused) wxArtStockMapping{wxId, stockId}, + #define ART(wxId, stockId, unused) wxArtStockMapping(wxId, stockId), #endif static const wxArtStockMapping wxId2GtkMap[] = @@ -140,9 +145,9 @@ wxString wxArtIDToStock(const wxArtID& id) for (unsigned i = 0; i < WXSIZEOF(wxId2GtkMap); i++) { - if (id == wxId2GtkMap[i].artId) + if (id == wxId2GtkMap[i].m_artId) { - return wxId2GtkMap[i].stockId; + return wxId2GtkMap[i].m_stockId; } } return id;