mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 21:40:19 +00:00
css: Emit deprecation warnings only under debug
This commit is contained in:
parent
cfcc5c5c0b
commit
3fef45683c
@ -26,6 +26,10 @@
|
||||
#include "gtkcsserror.h"
|
||||
#include "gtkcsslocationprivate.h"
|
||||
|
||||
/* We cannot include gtkdebug.h, so we must keep this in sync */
|
||||
extern unsigned int gtk_get_debug_flags (void);
|
||||
#define DEBUG_CHECK_CSS ((gtk_get_debug_flags () & GTK_CSS_PARSER_DEBUG_CSS) != 0)
|
||||
|
||||
static void clear_ref (GtkCssVariableValueReference *ref);
|
||||
|
||||
#define GDK_ARRAY_NAME gtk_css_parser_references
|
||||
@ -816,6 +820,8 @@ void
|
||||
gtk_css_parser_warn_deprecated (GtkCssParser *self,
|
||||
const char *format,
|
||||
...)
|
||||
{
|
||||
if (DEBUG_CHECK_CSS)
|
||||
{
|
||||
va_list args;
|
||||
GError *error;
|
||||
@ -831,6 +837,7 @@ gtk_css_parser_warn_deprecated (GtkCssParser *self,
|
||||
g_error_free (error);
|
||||
va_end (args);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_css_parser_consume_function (GtkCssParser *self,
|
||||
|
@ -172,5 +172,9 @@ void gtk_css_parser_get_expanding_variables (GtkCssParser
|
||||
char ***names,
|
||||
gsize *n_variables);
|
||||
|
||||
|
||||
/* We cannot include gtkdebug.h, so we must keep this in sync */
|
||||
#define GTK_CSS_PARSER_DEBUG_CSS (1 << 20)
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -52,6 +52,9 @@
|
||||
#define GDK_ARRAY_PREALLOC 64
|
||||
#include "gdk/gdkarrayimpl.c"
|
||||
|
||||
/* For lack of a better place, assert here that these two definitions match */
|
||||
G_STATIC_ASSERT (GTK_DEBUG_CSS == GTK_CSS_PARSER_DEBUG_CSS);
|
||||
|
||||
/**
|
||||
* GtkCssProvider:
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user