summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-10-11 13:33:07 -0400
committerMatthias Clasen <mclasen@redhat.com>2011-10-11 13:42:58 -0400
commita1acf35653ac5d437bdd8dce1b2b56333b005c0c (patch)
tree41f23254c80cc9d210047d79239c1ae5c31dd54c
parent0da0411a4a2f9efde4f8fc3d6bf504ee488c2e4a (diff)
Add our own deprecation macros
This will allow to suppress deprecation warnings on a per-module basis, if needed. They are on by default now, though.
-rw-r--r--docs/reference/glib/glib-sections.txt2
-rw-r--r--glib/gmacros.h14
2 files changed, 16 insertions, 0 deletions
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt
index 992443aa4..0e34cb081 100644
--- a/docs/reference/glib/glib-sections.txt
+++ b/docs/reference/glib/glib-sections.txt
@@ -406,6 +406,8 @@ G_HAVE_GNUC_VARARGS
G_HAVE_ISO_VARARGS
G_HAVE_GROWING_STACK
G_VA_COPY_AS_ARRAY
+GLIB_DEPRECATED
+GLIB_DEPRECATED_FOR
</SECTION>
<SECTION>
diff --git a/glib/gmacros.h b/glib/gmacros.h
index 83eef9e77..47adc8a18 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -304,4 +304,18 @@
#endif
+/* These macros are used to mark deprecated functions in GLib headers,
+ * and thus have to be exposed in installed headers. But please
+ * do *not* use them in other projects. Instead, use G_DEPRECATED
+ * or define your own wrappers around it.
+ */
+
+#ifdef GLIB_DISABLE_DEPRECATION_WARNINGS
+#define GLIB_DEPRECATED
+#define GLIB_DEPRECATED_FOR(f)
+#else
+#define GLIB_DEPRECATED G_DEPRECATED
+#define GLIB_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
+#endif
+
#endif /* __G_MACROS_H__ */