]> git.sesse.net Git - vlc/commitdiff
Fix HAVE_ATTRIBUTE_FORMAT usage - refs #297
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 26 May 2008 16:58:44 +0000 (19:58 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 26 May 2008 16:58:57 +0000 (19:58 +0300)
configure.ac
include/vlc_charset.h
include/vlc_common.h
include/vlc_httpd.h
include/vlc_input.h
include/vlc_interface.h
include/vlc_messages.h
include/vlc_network.h
include/vlc_osd.h
include/vlc_sout.h
include/vlc_vlm.h

index d7c9656cf5e027855469dd5226b7b8398b5dcca3..46faa57048101a43ad14aba8b93a10fa41b62977 100644 (file)
@@ -1115,19 +1115,6 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
 fi
 
-dnl Checks for __attribute__(format()) directive
-AC_CACHE_CHECK([__attribute__ ((format ())) support with function pointers],
-    [ac_cv_c_attribute_format],
-    [ac_cv_c_attribute_format=no
-        CFLAGS="${CFLAGS_save} -Werror"
-        AC_TRY_COMPILE([],
-        [static void (*pf_printf)(const char *, ...) __attribute__ ((format(printf,1,2)));(void)pf_printf;],
-        [ac_cv_c_attribute_format=yes])
-        CFLAGS="${CFLAGS_save}"])
-if test "${ac_cv_c_attribute_format}" != "no"; then
-    AC_DEFINE(HAVE_ATTRIBUTE_FORMAT, 1, Support for __attribute__((format())) with function pointers)
-fi
-
 dnl Check for __attribute__((packed))
 AC_CACHE_CHECK([for __attribute__((packed))],
   [ac_cv_c_attribute_packed],
index 8cb9c29fcdaef95b30c159665dbe06cbbcac01ab..8519904005931048c04e7456c4a1ff484d09ed88 100644 (file)
@@ -57,7 +57,7 @@ VLC_EXPORT( int, utf8_stat, ( const char *filename, struct stat *buf ) );
 VLC_EXPORT( int, utf8_lstat, ( const char *filename, struct stat *buf ) );
 
 VLC_EXPORT( int, utf8_vfprintf, ( FILE *stream, const char *fmt, va_list ap ) );
-VLC_EXPORT( int, utf8_fprintf, ( FILE *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) );
+VLC_EXPORT( int, utf8_fprintf, ( FILE *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) );
 
 VLC_EXPORT( char *, EnsureUTF8, ( char * ) );
 VLC_EXPORT( const char *, IsUTF8, ( const char * ) );
index a11085255ab5da0a242d1339e9eb614ac3af4f55..3c937967347fc81ed4caf4ac03c5c236e79348bd 100644 (file)
@@ -678,10 +678,10 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
 #endif
 
 /* Format string sanity checks */
-#ifdef HAVE_ATTRIBUTE_FORMAT
-#   define ATTRIBUTE_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
+#ifdef __GNUC__
+#   define LIBVLC_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
 #else
-#   define ATTRIBUTE_FORMAT(x,y)
+#   define LIBVLC_FORMAT(x,y)
 #endif
 
 /* Alignment of critical static data structures */
index 3b3d094849dbc71e76a73fdd01b130b689cde308..b5135c62b8f6793bf020858ae4122d8aec2f64bb 100644 (file)
@@ -140,7 +140,7 @@ VLC_EXPORT( int,              httpd_StreamSend,   ( httpd_stream_t *, uint8_t *p
 
 /* Msg functions facilities */
 VLC_EXPORT( void,         httpd_MsgInit, ( httpd_message_t * )  );
-VLC_EXPORT( void,         httpd_MsgAdd, ( httpd_message_t *, const char *psz_name, const char *psz_value, ... ) ATTRIBUTE_FORMAT( 3, 4 ) );
+VLC_EXPORT( void,         httpd_MsgAdd, ( httpd_message_t *, const char *psz_name, const char *psz_value, ... ) LIBVLC_FORMAT( 3, 4 ) );
 /* return "" if not found. The string is not allocated */
 VLC_EXPORT( const char *, httpd_MsgGet, ( const httpd_message_t *, const char *psz_name ) );
 VLC_EXPORT( void,         httpd_MsgClean, ( httpd_message_t * ) );
index 738b3745208f8e6f9700b85a196c2a16b850ac5d..70bf2b42caee0662f072da1caeb2215b3653b6d8 100644 (file)
@@ -317,7 +317,7 @@ static inline void input_item_MetaMerge( input_item_t *p_i, const vlc_meta_t * p
 #define input_item_GetSetting( item )        input_item_GetMeta( item, vlc_meta_Setting )
 
 VLC_EXPORT( char *, input_ItemGetInfo, ( input_item_t *p_i, const char *psz_cat,const char *psz_name ) );
-VLC_EXPORT(int, input_ItemAddInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format, ... ) ATTRIBUTE_FORMAT( 4, 5 ) );
+VLC_EXPORT(int, input_ItemAddInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format, ... ) LIBVLC_FORMAT( 4, 5 ) );
 
 #define input_ItemNew( a,b,c ) input_ItemNewExt( a, b, c, 0, NULL, -1 )
 #define input_ItemNewExt(a,b,c,d,e,f) __input_ItemNewExt( VLC_OBJECT(a),b,c,d,e,f)
index 61ed04ea8558664a2540bce4cea943ffef53d9b1..8040ab8405f9e72487817b2cd7ab74b9b10ba0a7 100644 (file)
@@ -312,9 +312,9 @@ struct interaction_t
  ***************************************************************************/
 
 #define intf_UserFatal( a, b, c, d, e... ) __intf_UserFatal( VLC_OBJECT(a),b,c,d, ## e )
-VLC_EXPORT( int, __intf_UserFatal,( vlc_object_t*, bool, const char*, const char*, ...) ATTRIBUTE_FORMAT( 4, 5 ) );
+VLC_EXPORT( int, __intf_UserFatal,( vlc_object_t*, bool, const char*, const char*, ...) LIBVLC_FORMAT( 4, 5 ) );
 #define intf_UserWarn( a, c, d, e... ) __intf_UserWarn( VLC_OBJECT(a),c,d, ## e )
-VLC_EXPORT( int, __intf_UserWarn,( vlc_object_t*, const char*, const char*, ...) ATTRIBUTE_FORMAT( 3, 4 ) );
+VLC_EXPORT( int, __intf_UserWarn,( vlc_object_t*, const char*, const char*, ...) LIBVLC_FORMAT( 3, 4 ) );
 #define intf_UserLoginPassword( a, b, c, d, e... ) __intf_UserLoginPassword( VLC_OBJECT(a),b,c,d,e)
 VLC_EXPORT( int, __intf_UserLoginPassword,( vlc_object_t*, const char*, const char*, char **, char **) );
 #define intf_UserYesNo( a, b, c, d, e, f ) __intf_UserYesNo( VLC_OBJECT(a),b,c, d, e, f )
index 8260bee1b5ad85d30d4308d31a721f21084305f7..76c0882aea66612d0bcd443610b8755a0b4c563f 100644 (file)
@@ -81,13 +81,13 @@ struct msg_subscription_t
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
-VLC_EXPORT( void, __msg_Generic, ( vlc_object_t *, int, const char *, const char *, ... ) ATTRIBUTE_FORMAT( 4, 5 ) );
+VLC_EXPORT( void, __msg_Generic, ( vlc_object_t *, int, const char *, const char *, ... ) LIBVLC_FORMAT( 4, 5 ) );
 VLC_EXPORT( void, __msg_GenericVa, ( vlc_object_t *, int, const char *, const char *, va_list args ) );
 #define msg_GenericVa(a, b, c, d, e) __msg_GenericVa(VLC_OBJECT(a), b, c, d, e)
-VLC_EXPORT( void, __msg_Info,    ( vlc_object_t *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) );
-VLC_EXPORT( void, __msg_Err,     ( vlc_object_t *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) );
-VLC_EXPORT( void, __msg_Warn,    ( vlc_object_t *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) );
-VLC_EXPORT( void, __msg_Dbg,    ( vlc_object_t *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) );
+VLC_EXPORT( void, __msg_Info,    ( vlc_object_t *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) );
+VLC_EXPORT( void, __msg_Err,     ( vlc_object_t *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) );
+VLC_EXPORT( void, __msg_Warn,    ( vlc_object_t *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) );
+VLC_EXPORT( void, __msg_Dbg,    ( vlc_object_t *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) );
 
 #define msg_Info( p_this, ... ) \
       __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_INFO, \
index ce413f86ab614a984a92fbdfe1a6fc6e4b82f0db..77cb6f0d8b228868084837b072bbfc7c92cd11f8 100644 (file)
@@ -148,7 +148,7 @@ VLC_EXPORT( ssize_t, __net_Write, ( vlc_object_t *p_this, int fd, const v_socket
 #define net_Gets(a,b,c) __net_Gets(VLC_OBJECT(a),b,c)
 VLC_EXPORT( char *, __net_Gets, ( vlc_object_t *p_this, int fd, const v_socket_t * ) );
 
-VLC_EXPORT( ssize_t, net_Printf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, ... ) ATTRIBUTE_FORMAT( 4, 5 ) );
+VLC_EXPORT( ssize_t, net_Printf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, ... ) LIBVLC_FORMAT( 4, 5 ) );
 
 #define net_vaPrintf(a,b,c,d,e) __net_vaPrintf(VLC_OBJECT(a),b,c,d,e)
 VLC_EXPORT( ssize_t, __net_vaPrintf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args ) );
index a30d0c5e01f89ab4bcd7167bbc19ea57f210fb64..22fce40b7bc83d91ec22594b1b795f02ae6b198b 100644 (file)
@@ -595,7 +595,7 @@ static inline void osd_SetMenuUpdate( osd_menu_t *p_osd, bool b_value )
  */
 VLC_EXPORT( int, osd_ShowTextRelative, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t ) );
 VLC_EXPORT( int, osd_ShowTextAbsolute, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
-VLC_EXPORT( void,osd_Message, ( spu_t *, int, char *, ... ) ATTRIBUTE_FORMAT( 3, 4 ) );
+VLC_EXPORT( void,osd_Message, ( spu_t *, int, char *, ... ) LIBVLC_FORMAT( 3, 4 ) );
 
 /**
  * Default feedback images
@@ -650,7 +650,7 @@ VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, const char *, te
  * \param i_channel Subpicture channel
  * \param psz_format printf style formatting
  **/
-VLC_EXPORT( void,  __vout_OSDMessage, ( vlc_object_t *, int, const char *, ... ) ATTRIBUTE_FORMAT( 3, 4 ) );
+VLC_EXPORT( void,  __vout_OSDMessage, ( vlc_object_t *, int, const char *, ... ) LIBVLC_FORMAT( 3, 4 ) );
 
 /**
  * Same as __vlc_OSDMessage() but with automatic casting
index 657b43bee3348f44c4909e9f49690a77221c4b53..cb2ef6f488e76439e13cb02d8eb65d4bf4779b2e 100644 (file)
@@ -235,7 +235,7 @@ VLC_EXPORT(void,                 sout_MethodRelease, (announce_method_t *) );
 
 VLC_EXPORT( char *, vlc_sdp_Start, ( vlc_object_t *obj, const char *cfgpref, const struct sockaddr *src, size_t srclen, const struct sockaddr *addr, size_t addrlen ) );
 VLC_EXPORT( char *, sdp_AddMedia, (char **sdp, const char *type, const char *protocol, int dport, unsigned pt, bool bw_indep, unsigned bw, const char *ptname, unsigned clockrate, unsigned channels, const char *fmtp) );
-VLC_EXPORT( char *, sdp_AddAttribute, (char **sdp, const char *name, const char *fmt, ...) ATTRIBUTE_FORMAT( 3, 4 ) );
+VLC_EXPORT( char *, sdp_AddAttribute, (char **sdp, const char *name, const char *fmt, ...) LIBVLC_FORMAT( 3, 4 ) );
 
 
 #ifdef __cplusplus
index 9bbb4a57cd45b0302b49b0ebd11b288c520249af..8a54ab97ef6e4708c3a2e7a9326f06dfb951e550 100644 (file)
@@ -157,7 +157,7 @@ VLC_EXPORT( void,      vlm_Delete, ( vlm_t * ) );
 VLC_EXPORT( int,       vlm_ExecuteCommand, ( vlm_t *, const char *, vlm_message_t ** ) );
 VLC_EXPORT( int,       vlm_Control, ( vlm_t *p_vlm, int i_query, ... ) );
 
-VLC_EXPORT( vlm_message_t *, vlm_MessageNew, ( const char *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) );
+VLC_EXPORT( vlm_message_t *, vlm_MessageNew, ( const char *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) );
 VLC_EXPORT( vlm_message_t *, vlm_MessageAdd, ( vlm_message_t *, vlm_message_t * ) );
 VLC_EXPORT( void,            vlm_MessageDelete, ( vlm_message_t * ) );