diff options
author | Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com> | 2005-01-23 23:08:07 +0000 |
---|---|---|
committer | Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com> | 2005-01-23 23:08:07 +0000 |
commit | fc0372b209d21cb6317078f63774aa4bef6dff29 (patch) | |
tree | c63574bd1073fcd16e003ed0d014e5a272f859bf /firmware/include/sprintf.h | |
parent | 2e41950fcf98b4f5eee95e2e5e72681557eca585 (diff) |
Support for %l* plus __attribute__ printf support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5641 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/include/sprintf.h')
-rw-r--r-- | firmware/include/sprintf.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/firmware/include/sprintf.h b/firmware/include/sprintf.h index 61a5f5139f..d68647ee72 100644 --- a/firmware/include/sprintf.h +++ b/firmware/include/sprintf.h @@ -23,8 +23,17 @@ #include <stddef.h> #include <stdarg.h> -int snprintf (char *buf, size_t size, const char *fmt, ...); +#ifdef __GNUC__ +#define ATTRIBUTE_PRINTF(fmt, arg1) __attribute__ ( ( format( printf, fmt, arg1 ) ) ) +#else +#define ATTRIBUTE_PRINTF(fmt, arg1) +#endif + +int snprintf (char *buf, size_t size, const char *fmt, ...) + ATTRIBUTE_PRINTF(3, 4); + int vsnprintf (char *buf, int size, const char *fmt, va_list ap); -int fprintf (int fd, const char *fmt, ...); +int fprintf (int fd, const char *fmt, ...) + ATTRIBUTE_PRINTF(2, 3); #endif /* __SPRINTF_H__ */ |