[glib] Fix g_variant_get_gtype() deprecation message



commit a5bf1c117b9042906763d166f396e8cccaf48f91
Author: Dan Winship <danw gnome org>
Date:   Mon Nov 7 13:48:30 2011 -0500

    Fix g_variant_get_gtype() deprecation message
    
    Instead of:
    
    warning: âg_variant_get_gtypeâ is deprecated (declared at ../../gobject/glib-types.h:242): Use '((GType) ((21) << (2)))' instead [-Wdeprecated-declarations]
    
    show:
    
    warning: âg_variant_get_gtypeâ is deprecated (declared at ../../gobject/glib-types.h:242): Use ''G_VARIANT_GET_TYPE'' instead [-Wdeprecated-declarations]
    
    Also, document the macro-expansion problem in the
    G_GNUC_DEPRECATED_FOR docs

 docs/reference/glib/tmpl/macros_misc.sgml |    7 +++++++
 gobject/glib-types.h                      |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/glib/tmpl/macros_misc.sgml b/docs/reference/glib/tmpl/macros_misc.sgml
index 309bded..647f4ca 100644
--- a/docs/reference/glib/tmpl/macros_misc.sgml
+++ b/docs/reference/glib/tmpl/macros_misc.sgml
@@ -284,6 +284,13 @@ new enough to support custom deprecation messages.
 See the GNU C documentation for details.
 </para>
 
+<para>
+Note that if <literal>f</literal> is a macro, it will be expanded in
+the warning message. You can enclose it in quotes to prevent this.
+(The quotes will show up in the warning, but it's better than showing
+the macro expansion.)
+</para>
+
 @f: the intended replacement for the deprecated symbol, such as the name of a
     function
 @Since: 2.26
diff --git a/gobject/glib-types.h b/gobject/glib-types.h
index c37c965..7bad68c 100644
--- a/gobject/glib-types.h
+++ b/gobject/glib-types.h
@@ -238,7 +238,7 @@ GType   g_main_loop_get_type       (void) G_GNUC_CONST;
 GType   g_main_context_get_type    (void) G_GNUC_CONST;
 GType   g_source_get_type          (void) G_GNUC_CONST;
 
-GLIB_DEPRECATED_FOR(G_TYPE_VARIANT)
+GLIB_DEPRECATED_FOR('G_TYPE_VARIANT')
 GType   g_variant_get_gtype        (void) G_GNUC_CONST;
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]