diff options
author | msvensson@shellback.(none) <> | 2006-10-03 00:48:26 +0200 |
---|---|---|
committer | msvensson@shellback.(none) <> | 2006-10-03 00:48:26 +0200 |
commit | b975b4a793809d9881c2913df7c7602d0416b2b9 (patch) | |
tree | d671be1bf5820db7a57e7b508f82f560b91e3359 /include | |
parent | d5ad8ff4a2e523ad8f9e45bd98a329f33f542266 (diff) | |
download | mariadb-git-b975b4a793809d9881c2913df7c7602d0416b2b9.tar.gz |
Add ATTRIBUTE_FORMAT_FPTR macro for setting format specifier also on function pointers
This was available from gcc 3.1, so diable it before that
Update m_ctype.h to use the new macro
Diffstat (limited to 'include')
-rw-r--r-- | include/m_ctype.h | 2 | ||||
-rw-r--r-- | include/my_global.h | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index b2bf8d3e30f..b507e2dc7de 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -175,7 +175,7 @@ typedef struct my_charset_handler_st /* Charset dependant snprintf() */ int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt, - ...) ATTRIBUTE_FORMAT(printf, 4, 5); + ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5); int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix, long int val); int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n, diff --git a/include/my_global.h b/include/my_global.h index d92df6fa743..41b660227b5 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -431,9 +431,6 @@ typedef unsigned short ushort; #ifndef __attribute__ # if !defined(__GNUC__) # define __attribute__(A) -# elif defined (__QNXNTO__) - /* qcc defines GNUC */ -# define __attribute__(A) # elif GCC_VERSION < 2008 # define __attribute__(A) # elif defined(__cplusplus) && GCC_VERSION < 3004 @@ -450,6 +447,19 @@ typedef unsigned short ushort; # define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n))) #endif +/* + __attribute__((format(...))) on a function pointer is not supported + until gcc 3.1 +*/ +#ifndef ATTRIBUTE_FORMAT_FPTR +# if (GCC_VERSION >= 3001) +# define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n) +# else +# define ATTRIBUTE_FORMAT_FPTR(style, m, n) +# endif /* GNUC >= 3.1 */ +#endif + + /* From old s-system.h */ /* |