Drop redundant GLib version check

We require GLib 2.76 now.
This commit is contained in:
Matthias Clasen 2024-06-02 20:05:45 -04:00
parent 1080822ffa
commit a2223c0884

View File

@ -48,22 +48,6 @@ usage (void)
exit (1);
}
/* 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 GLogWriterOutput
log_writer_func (GLogLevelFlags level,
const GLogField *fields,
@ -82,7 +66,7 @@ log_writer_func (GLogLevelFlags level,
message = fields[i].value;
}
if (message != NULL && !would_drop (level, domain))
if (message != NULL && !g_log_writer_would_drop (level, domain))
{
const char *prefix;
switch (level & G_LOG_LEVEL_MASK)