[vlc-devel] commit: Add and use LIBVLC_FORMAT_ARG for gettext functions ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Sep 24 19:52:36 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Sep 24 20:51:50 2009 +0300| [d5326a15087b5c0916c2dd1245c0b724551aaf02] | committer: Rémi Denis-Courmont 

Add and use LIBVLC_FORMAT_ARG for gettext functions

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

 include/vlc_common.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 2244cdb..b771f99 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -59,10 +59,12 @@
 /* Format string sanity checks */
 #ifdef __GNUC__
 #   define LIBVLC_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
+#   define LIBVLC_FORMAT_ARG(x) __attribute__ ((format_arg(x)))
 #   define LIBVLC_USED __attribute__ ((warn_unused_result))
 #   define LIBVLC_MALLOC __attribute__ ((malloc))
 #else
 #   define LIBVLC_FORMAT(x,y)
+#   define LIBVLC_FORMAT_ARG(x)
 #   define LIBVLC_USED
 #   define LIBVLC_MALLOC
 #endif
@@ -794,8 +796,9 @@ VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) );
 /*****************************************************************************
  * I18n stuff
  *****************************************************************************/
-VLC_EXPORT( char *, vlc_gettext, ( const char *msgid ) LIBVLC_USED );
+VLC_EXPORT( char *, vlc_gettext, ( const char *msgid ) LIBVLC_FORMAT_ARG(1) );
 
+LIBVLC_FORMAT_ARG(2)
 static inline const char *vlc_pgettext( const char *ctx, const char *id )
 {
     const char *tr = vlc_gettext( id );




More information about the vlc-devel mailing list