Merge branch 'build-fix-glib-2.66' into 'main'
build: fix for use with glib 2.66.0 (2nd try) See merge request GNOME/gtk!4932
This commit is contained in:
@@ -47,6 +47,10 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 67, 3)
|
||||||
|
# define g_memdup2(mem,size) g_memdup((mem), (size))
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
static void gdk_broadway_surface_finalize (GObject *object);
|
static void gdk_broadway_surface_finalize (GObject *object);
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,22 @@ static const GOptionEntry test_args[] = {
|
|||||||
|
|
||||||
static gboolean using_tap;
|
static gboolean using_tap;
|
||||||
|
|
||||||
|
/* A simplified version of g_log_writer_default_would_drop(), to avoid
|
||||||
|
* bumping up the required version of GLib to 2.68
|
||||||
|
*/
|
||||||
|
static gboolean
|
||||||
|
would_drop (GLogLevelFlags level,
|
||||||
|
const char *domain)
|
||||||
|
{
|
||||||
|
#if GLIB_CHECK_VERSION (2, 68, 0)
|
||||||
|
return g_log_writer_default_would_drop (level, domain);
|
||||||
|
#else
|
||||||
|
return (level & (G_LOG_LEVEL_ERROR |
|
||||||
|
G_LOG_LEVEL_CRITICAL |
|
||||||
|
G_LOG_LEVEL_WARNING)) == 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
parse_command_line (int *argc, char ***argv)
|
parse_command_line (int *argc, char ***argv)
|
||||||
{
|
{
|
||||||
@@ -497,7 +513,7 @@ log_writer (GLogLevelFlags log_level,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!g_log_writer_default_would_drop (log_level, NULL))
|
if (!would_drop (log_level, NULL))
|
||||||
return g_log_writer_standard_streams (log_level, fields, n_fields, user_data);
|
return g_log_writer_standard_streams (log_level, fields, n_fields, user_data);
|
||||||
|
|
||||||
return G_LOG_WRITER_HANDLED;
|
return G_LOG_WRITER_HANDLED;
|
||||||
|
|||||||
Reference in New Issue
Block a user