diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index 464d72a5f..992443aa4 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -362,6 +362,10 @@ G_HAVE_GNUC_VISIBILITY G_GNUC_INTERNAL G_GNUC_MAY_ALIAS + +G_DEPRECATED +G_DEPRECATED_FOR + G_LIKELY G_UNLIKELY diff --git a/glib/gmacros.h b/glib/gmacros.h index 50a03ed0d..83eef9e77 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -287,4 +287,21 @@ #define G_UNLIKELY(expr) (expr) #endif +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +#define G_DEPRECATED __attribute__((__deprecated__)) +#elif defined(_MSC_VER) && (_MSC_VER >= 1300) +#define G_GNUC_DEPRECATED __declspec(deprecated) +#else +#define G_DEPRECATED +#endif + +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +#define G_DEPRECATED_FOR(f) __attribute__((deprecated("Use '" #f "' instead"))) +#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320) +#define G_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead")) +#else +#define G_DEPRECATED_FOR(f) G_DEPRECATED +#endif + + #endif /* __G_MACROS_H__ */