Better definition & usage of the ATTRIBUTE_PRINTF macro

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6080 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jean-Philippe Bernardy 2005-02-28 09:48:35 +00:00
parent a5fbdbb73f
commit 5426994398
3 changed files with 6 additions and 7 deletions

View file

@ -20,6 +20,8 @@
#ifndef __PANIC_H__
#define __PANIC_H__
void panicf( const char *fmt, ... );
#include "_ansi.h"
void panicf( const char *fmt, ... ) ATTRIBUTE_PRINTF(1, 2);
#endif /* __PANIC_H__ */

View file

@ -72,4 +72,6 @@
#define _ATTRIBUTE(attrs)
#endif
#define ATTRIBUTE_PRINTF(fmt, arg1) _ATTRIBUTE( ( format( printf, fmt, arg1 ) ) )
#endif /* _ANSIDECL_H_ */

View file

@ -22,12 +22,7 @@
#include <stddef.h>
#include <stdarg.h>
#ifdef __GNUC__
#define ATTRIBUTE_PRINTF(fmt, arg1) __attribute__ ( ( format( printf, fmt, arg1 ) ) )
#else
#define ATTRIBUTE_PRINTF(fmt, arg1)
#endif
#include <_ansi.h>
int snprintf (char *buf, size_t size, const char *fmt, ...)
ATTRIBUTE_PRINTF(3, 4);