]> git.sesse.net Git - vlc/commitdiff
Add and use LIBVLC_FORMAT_ARG for gettext functions
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 24 Sep 2009 17:51:50 +0000 (20:51 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 24 Sep 2009 17:51:50 +0000 (20:51 +0300)
include/vlc_common.h

index 2244cdbbf0dea75dcbe908dceaf91dbdf508001f..b771f99664feede84d816376360336aa54cd2edb 100644 (file)
 /* 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 );