Re: Deprecation and GSEAL

On Thu, 2009-04-16 at 18:33 +0100, Simon McVittie wrote:
> GLib defines G_GNUC_DEPRECATED, which expands to
> __attribute__((deprecated))
> in gcc versions that support it.

Oh, awesome.  I don't think I ever noticed this before.  Maybe because
it looks like it's never used anywhere.

So here is an amended version that includes this, and also at timj's
suggestion has another preprocessor check for "GSEAL_NO_ERRORS".  So
with this you would need to -DGSEAL_ENABLE -DGSEAL_NO_ERRORS to get
warnings instead of errors.

#ifndef GSEAL
/* introduce GSEAL() here for all of Gdk and Gtk+ without the need to
modify GLib */
#    ifdef GSEAL_NO_ERRORS
#      define GSEAL(ident)      G_GNUC_DEPRECATED ident
#    else
#      define GSEAL(ident)      _g_sealed__ ## ident
#    endif
#  else
#    define GSEAL(ident)      ident
#  endif
#endif /* !GSEAL */

/ Cody

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