Avoid deprecation warnings for gdk_threads_enter/leave()

Use wrapper functions just to avoid the warnings for them, as we want to
keep calling them for compatibility, even if the functions are
deprecated in GTK since a very long time.
This commit is contained in:
Vadim Zeitlin 2022-09-23 00:51:56 +02:00
parent 0922873cf1
commit dbdcf8fb91
2 changed files with 15 additions and 0 deletions

View file

@ -10,6 +10,20 @@
#ifndef _WX_GTK_PRIVATE_THREADS_H_
#define _WX_GTK_PRIVATE_THREADS_H_
// ----------------------------------------------------------------------------
// Redefine GDK functions to avoiding deprecation warnings
// ----------------------------------------------------------------------------
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
static inline void wx_gdk_threads_enter() { gdk_threads_enter(); }
#define gdk_threads_enter wx_gdk_threads_enter
static inline void wx_gdk_threads_leave() { gdk_threads_leave(); }
#define gdk_threads_leave wx_gdk_threads_leave
wxGCC_WARNING_RESTORE(deprecated-declarations)
// ----------------------------------------------------------------------------
// RAII wrapper for acquiring/leaving GDK lock in ctor/dtor
// ----------------------------------------------------------------------------

View file

@ -31,6 +31,7 @@
#include "wx/gtk/private.h"
#include "wx/gtk/private/log.h"
#include "wx/gtk/private/threads.h"
#include "wx/gtk/mimetype.h"
//-----------------------------------------------------------------------------