Commit d5326a15 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Add and use LIBVLC_FORMAT_ARG for gettext functions

parent c21a111a
...@@ -59,10 +59,12 @@ ...@@ -59,10 +59,12 @@
/* Format string sanity checks */ /* Format string sanity checks */
#ifdef __GNUC__ #ifdef __GNUC__
# define LIBVLC_FORMAT(x,y) __attribute__ ((format(printf,x,y))) # 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_USED __attribute__ ((warn_unused_result))
# define LIBVLC_MALLOC __attribute__ ((malloc)) # define LIBVLC_MALLOC __attribute__ ((malloc))
#else #else
# define LIBVLC_FORMAT(x,y) # define LIBVLC_FORMAT(x,y)
# define LIBVLC_FORMAT_ARG(x)
# define LIBVLC_USED # define LIBVLC_USED
# define LIBVLC_MALLOC # define LIBVLC_MALLOC
#endif #endif
...@@ -794,8 +796,9 @@ VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) ); ...@@ -794,8 +796,9 @@ VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) );
/***************************************************************************** /*****************************************************************************
* I18n stuff * 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 ) static inline const char *vlc_pgettext( const char *ctx, const char *id )
{ {
const char *tr = vlc_gettext( id ); const char *tr = vlc_gettext( id );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment