Add a dummy declaration to ssprintf

G++ doesn't allow attributes on function definitions for reasons. Add a
declaration immediately before the definition so it works.
issue1247
Nicolas Hake 2015-02-12 23:14:16 +01:00
parent e21a5bdd44
commit 95641b5fb0
1 changed files with 2 additions and 1 deletions

View File

@ -161,8 +161,9 @@ inline int osprintf(char *str, const char *fmt, ...)
// secure sprintf
#define sprintf ssprintf
template <size_t N> inline int ssprintf(char(&str)[N], const char *fmt, ...) GNUC_FORMAT_ATTRIBUTE_O;
template <size_t N>
inline int ssprintf(char(&str)[N], const char *fmt, ...) GNUC_FORMAT_ATTRIBUTE_O
inline int ssprintf(char(&str)[N], const char *fmt, ...)
{
va_list args; va_start(args, fmt);
int m = vsnprintf(str, N, fmt, args);