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:
parent
a5fbdbb73f
commit
5426994398
3 changed files with 6 additions and 7 deletions
|
@ -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__ */
|
||||
|
|
|
@ -72,4 +72,6 @@
|
|||
#define _ATTRIBUTE(attrs)
|
||||
#endif
|
||||
|
||||
#define ATTRIBUTE_PRINTF(fmt, arg1) _ATTRIBUTE( ( format( printf, fmt, arg1 ) ) )
|
||||
|
||||
#endif /* _ANSIDECL_H_ */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue