From 8649f2548ebeb7e6154ce04777689b9311e83ae0 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 19 Apr 2020 11:09:09 -0700 Subject: [PATCH] Avoid some deprecation warnings from GTK2 headers --- samples/widgets/native.cpp | 4 +++- src/gtk/eggtrayicon.c | 1 + src/gtk/treeentry_gtk.c | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/samples/widgets/native.cpp b/samples/widgets/native.cpp index d355a85251..45847c4d40 100644 --- a/samples/widgets/native.cpp +++ b/samples/widgets/native.cpp @@ -143,10 +143,12 @@ protected: #elif defined(__WXGTK__) -// Avoid a bunch of warnings from gtk.h for some GTK+ 3 versions. +// Avoid a bunch of warnings from gtk.h for some GTK+ versions. +wxGCC_WARNING_SUPPRESS(deprecated-declarations) wxGCC_WARNING_SUPPRESS(parentheses) #include wxGCC_WARNING_RESTORE(parentheses) +wxGCC_WARNING_RESTORE(deprecated-declarations) class NativeWindow : public wxNativeWindow { diff --git a/src/gtk/eggtrayicon.c b/src/gtk/eggtrayicon.c index bd048ae634..fbb683a9f8 100644 --- a/src/gtk/eggtrayicon.c +++ b/src/gtk/eggtrayicon.c @@ -109,6 +109,7 @@ Anders #if wxUSE_TASKBARICON +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include #if GTK_CHECK_VERSION(2, 1, 0) diff --git a/src/gtk/treeentry_gtk.c b/src/gtk/treeentry_gtk.c index 96b5747e86..61738e0327 100644 --- a/src/gtk/treeentry_gtk.c +++ b/src/gtk/treeentry_gtk.c @@ -13,6 +13,11 @@ typedef pid_t GPid; #define GSEAL(x) x #endif +#include "wx/setup.h" +#ifndef __WXGTK3__ + #define GLIB_DISABLE_DEPRECATION_WARNINGS +#endif + #include "wx/gtk/private/treeentry_gtk.h" /*