gmacros: Add G_GNUC_UNAVAILABLE

A macro to annotate a function as not available, when compiling with GCC.
This commit is contained in:
Emmanuele Bassi 2012-02-20 16:19:31 +00:00 committed by Emmanuele Bassi
parent 9e5ff3d3eb
commit 11de54927d

View File

@ -138,6 +138,13 @@
#define G_GNUC_WARN_UNUSED_RESULT #define G_GNUC_WARN_UNUSED_RESULT
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define G_GNUC_UNAVAILABLE __attribute__((unavailable))
#else
#define G_GNUC_UNAVAILABLE
#endif /* __GNUC__ */
#ifndef G_DISABLE_DEPRECATED #ifndef G_DISABLE_DEPRECATED
/* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with /* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
* macros, so we can refer to them as strings unconditionally. * macros, so we can refer to them as strings unconditionally.