Add G_GNUC_DEPRECATED_FOR macro
authorEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 6 Apr 2010 15:17:18 +0000 (16:17 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 23 Apr 2010 14:26:49 +0000 (15:26 +0100)
commit38e2273207783e4396aabd47bdab5f28155ad6ae
tree2017199a01d9053c262964662a11e50c3865ddf5
parent8f82b994c9963ad23a32f302dc2166f5ca4c2564
Add G_GNUC_DEPRECATED_FOR macro

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
glib/gmacros.h