From 19c6e004cec3d6192cdc73a46c4a4ef373ffc8fa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 9 Oct 2019 14:57:58 +0200 Subject: [PATCH] Don't use g_thread_supported() with non-ancient glib versions This is useless, as it always returns true (since 2.31), and just results in warnings about using deprecated macro (since 2.62). Also remove the now unnecessary warning suppression macros, as g_thread_init() wasn't deprecated in 2.30 yet, so it shouldn't give any warnings in glib versions in which it could be actually used. --- src/gtk/app.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 2784771dc5..4721bcd85b 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -276,6 +276,8 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_) if ( !wxAppBase::Initialize(argc_, argv_) ) return false; + // Thread support is always on since glib 2.31. +#if !GLIB_CHECK_VERSION(2, 31, 0) #if wxUSE_THREADS if (!g_thread_supported()) { @@ -283,12 +285,11 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_) // might still be needed in the older versions, which are the only ones // for which this code is going to be executed (as g_thread_supported() // is always TRUE in these recent glib versions anyhow). - wxGCC_WARNING_SUPPRESS(deprecated-declarations) g_thread_init(NULL); - wxGCC_WARNING_RESTORE() gdk_threads_init(); } #endif // wxUSE_THREADS +#endif // glib < 2.31 // gtk+ 2.0 supports Unicode through UTF-8 strings wxConvCurrent = &wxConvUTF8;