[vlc-commits] Use a macro for the deprecated attribute.

Rémi Duraffort git at videolan.org
Tue Feb 15 00:13:05 CET 2011


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Feb 15 00:12:40 2011 +0100| [cd95603da45020ab52343891ad7044e092932c91] | committer: Rémi Duraffort

Use a macro for the deprecated attribute.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cd95603da45020ab52343891ad7044e092932c91
---

 include/vlc_common.h  |    6 ++++++
 include/vlc_objects.h |   10 ++--------
 include/vlc_threads.h |   15 +++------------
 3 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 7f488a5..b312a72 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -102,6 +102,12 @@
 #   define unlikely(p) (!!(p))
 #endif
 
+#if defined(__GNUC__) && !defined __cplusplus
+# define LIBVLC_DEPRECATED __attribute__((deprecated))
+#else
+# define LIBVLC_DEPRECATED
+#endif
+
 /*****************************************************************************
  * Basic types definitions
  *****************************************************************************/
diff --git a/include/vlc_objects.h b/include/vlc_objects.h
index ca2ef97..e1ece31 100644
--- a/include/vlc_objects.h
+++ b/include/vlc_objects.h
@@ -64,14 +64,8 @@ struct vlc_object_t
  *****************************************************************************/
 VLC_EXPORT( void *, vlc_object_create, ( vlc_object_t *, size_t ) ) LIBVLC_MALLOC LIBVLC_USED;
 VLC_EXPORT( void, vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) );
-#if defined (__GNUC__) && !defined __cplusplus
-__attribute__((deprecated))
-#endif
-VLC_EXPORT( void *, vlc_object_find, ( vlc_object_t *, int, int ) ) LIBVLC_USED;
-#if defined (__GNUC__) && !defined __cplusplus
-__attribute__((deprecated))
-#endif
-VLC_EXPORT( vlc_object_t *, vlc_object_find_name, ( vlc_object_t *, const char *, int ) ) LIBVLC_USED;
+VLC_EXPORT( void *, vlc_object_find, ( vlc_object_t *, int, int ) ) LIBVLC_USED LIBVLC_DEPRECATED;
+VLC_EXPORT( vlc_object_t *, vlc_object_find_name, ( vlc_object_t *, const char *, int ) ) LIBVLC_USED LIBVLC_DEPRECATED;
 VLC_EXPORT( void *, vlc_object_hold, ( vlc_object_t * ) );
 VLC_EXPORT( void, vlc_object_release, ( vlc_object_t * ) );
 VLC_EXPORT( vlc_list_t *, vlc_list_children, ( vlc_object_t * ) ) LIBVLC_USED;
diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index d53c9e3..d7b6b8a 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -194,18 +194,9 @@ VLC_EXPORT( int, vlc_threadvar_create, (vlc_threadvar_t * , void (*) (void *) )
 VLC_EXPORT( void, vlc_threadvar_delete, (vlc_threadvar_t *) );
 VLC_EXPORT( int, vlc_threadvar_set, (vlc_threadvar_t, void *) );
 VLC_EXPORT( void *, vlc_threadvar_get, (vlc_threadvar_t) );
-#if defined (__GNUC__) && !defined __cplusplus
-__attribute__((deprecated))
-#endif
-VLC_EXPORT( int,  vlc_thread_create, ( vlc_object_t *, void * ( * ) ( vlc_object_t * ), int ) LIBVLC_USED );
-#if defined (__GNUC__) && !defined __cplusplus
-__attribute__((deprecated))
-#endif
-VLC_EXPORT( int,  vlc_thread_set_priority, ( vlc_object_t *, int ) );
-#if defined (__GNUC__) && !defined __cplusplus
-__attribute__((deprecated))
-#endif
-VLC_EXPORT( void, vlc_thread_join,   ( vlc_object_t * ) );
+VLC_EXPORT( int,  vlc_thread_create, ( vlc_object_t *, void * ( * ) ( vlc_object_t * ), int ) LIBVLC_USED LIBVLC_DEPRECATED );
+VLC_EXPORT( int,  vlc_thread_set_priority, ( vlc_object_t *, int ) LIBVLC_DEPRECATED );
+VLC_EXPORT( void, vlc_thread_join,   ( vlc_object_t * ) LIBVLC_DEPRECATED );
 
 VLC_EXPORT( int, vlc_clone, (vlc_thread_t *, void * (*) (void *), void *, int) LIBVLC_USED );
 VLC_EXPORT( void, vlc_cancel, (vlc_thread_t) );



More information about the vlc-commits mailing list