• Emmanuele Bassi's avatar
    Add G_GNUC_DEPRECATED_FOR macro · 38e22732
    Emmanuele Bassi authored
    It would be good, error reporting-wise, to be able to signal which
    function should be used instead of a deprecated one. GCC 4.5 added an
    optional "message" payload to the deprecated attribute, so that:
    
      void f1 (void) __attribute__((deprecated("Use f2 instead")));
    
    Will expand to:
    
      warning: f1 is deprecated: Use f2 instead
    
    Instead of just printing:
    
      warning: f1 is deprecated
    
    Since we already have a G_GNUC_DEPRECATED macro we should provide a
    G_GNUC_DEPRECATED_FOR macro defined as:
    
      G_GNUC_DEPRECATED_FOR(bar)
    
    Which would expand the deprecation message to "Use bar instead"
    automatically. The deprecation message should probably be similar
    to what we use in gtk-doc to match up with the documentation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=614965
    38e22732
gmacros.h 9.41 KB