summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2006-10-21 17:43:30 +0000
committerHavoc Pennington <hp@redhat.com>2006-10-21 17:43:30 +0000
commit716059087dcf7caeb12313520eee8fc4b554ef54 (patch)
treecfa42ffe84320caa89314040215ce473d1454b15
parent174c63f176b9074ffe3cca8df016c53d68cafce9 (diff)
2006-10-21 Havoc Pennington <hp@redhat.com>
* dbus/dbus-macros.h: add DBUS_GNUC_DEPRECATED macro * dbus/dbus-message.h: mark dbus_message_iter_get_array_len() as DBUS_GNUC_DEPRECATED
-rw-r--r--ChangeLog7
-rw-r--r--Doxyfile.in1
-rw-r--r--dbus/dbus-macros.h26
-rw-r--r--dbus/dbus-message.c3
-rw-r--r--dbus/dbus-message.h2
5 files changed, 38 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d30a9556..5b0c320d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,11 @@
2006-10-21 Havoc Pennington <hp@redhat.com>
+
+ * dbus/dbus-macros.h: add DBUS_GNUC_DEPRECATED macro
+
+ * dbus/dbus-message.h: mark dbus_message_iter_get_array_len()
+ as DBUS_GNUC_DEPRECATED
+
+2006-10-21 Havoc Pennington <hp@redhat.com>
* Move all private API into the private Doxygen group sections of
the files, so they don't show up in the public API docs
diff --git a/Doxyfile.in b/Doxyfile.in
index c7d41fdb..80ee0d0a 100644
--- a/Doxyfile.in
+++ b/Doxyfile.in
@@ -146,6 +146,7 @@ INCLUDE_FILE_PATTERNS =
PREDEFINED = "DBUS_BEGIN_DECLS=" \
"DBUS_END_DECLS=" \
"DOXYGEN_SHOULD_SKIP_THIS" \
+ "DBUS_GNUC_DEPRECATED=" \
"_DBUS_DEFINE_GLOBAL_LOCK(name)=" \
"_DBUS_GNUC_PRINTF(from,to)="
SKIP_FUNCTION_MACROS = YES
diff --git a/dbus/dbus-macros.h b/dbus/dbus-macros.h
index abcb12a3..5d9524e1 100644
--- a/dbus/dbus-macros.h
+++ b/dbus/dbus-macros.h
@@ -50,6 +50,12 @@
# endif /* !__cplusplus */
#endif
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#define DBUS_GNUC_DEPRECATED __attribute__((__deprecated__))
+#else
+#define DBUS_GNUC_DEPRECATED
+#endif
+
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusMacros Utility macros
@@ -67,6 +73,9 @@
* Macro used prior to declaring functions in the D-Bus header
* files. Expands to "extern "C"" when using a C++ compiler,
* and expands to nothing when using a C compiler.
+ *
+ * Please don't use this in your own code, consider it
+ * D-Bus internal.
*/
/**
* @def DBUS_END_DECLS
@@ -74,6 +83,9 @@
* Macro used after declaring functions in the D-Bus header
* files. Expands to "}" when using a C++ compiler,
* and expands to nothing when using a C compiler.
+ *
+ * Please don't use this in your own code, consider it
+ * D-Bus internal.
*/
/**
* @def TRUE
@@ -90,6 +102,20 @@
*
* A null pointer, defined appropriately for C or C++.
*/
+/**
+ * @def DBUS_GNUC_DEPRECATED
+ *
+ * Tells gcc to warn about a function or type if it's used.
+ * Code marked in this way should also be enclosed in
+ * @code
+ * #ifndef DBUS_DISABLE_DEPRECATED
+ * deprecated stuff here
+ * #endif
+ * @endcode
+ *
+ * Please don't use this in your own code, consider it
+ * D-Bus internal.
+ */
/** @} */
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index 5b7a9903..983543da 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -1255,6 +1255,9 @@ dbus_message_new_error (DBusMessage *reply_to,
* See dbus_message_new_error() for details - this function is the same
* aside from the printf formatting.
*
+ * @todo add _DBUS_GNUC_PRINTF to this (requires moving _DBUS_GNUC_PRINTF to
+ * public header, see DBUS_GNUC_DEPRECATED for an example)
+ *
* @param reply_to the original message
* @param error_name the error name
* @param error_format the error message format as with printf
diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h
index b0351758..8be5faa5 100644
--- a/dbus/dbus-message.h
+++ b/dbus/dbus-message.h
@@ -167,7 +167,7 @@ void dbus_message_iter_get_basic (DBusMessageIter *iter,
/* This function returns the wire protocol size of the array in bytes,
* you do not want to know that probably
*/
-int dbus_message_iter_get_array_len (DBusMessageIter *iter);
+int dbus_message_iter_get_array_len (DBusMessageIter *iter) DBUS_GNUC_DEPRECATED;
#endif
void dbus_message_iter_get_fixed_array (DBusMessageIter *iter,
void *value,