aboutsummaryrefslogtreecommitdiffstats
path: root/common/mischelp.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/mischelp.h')
-rw-r--r--common/mischelp.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/common/mischelp.h b/common/mischelp.h
index dd1f3a620..e3c4fd198 100644
--- a/common/mischelp.h
+++ b/common/mischelp.h
@@ -55,9 +55,16 @@ time_t timegm (struct tm *tm);
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
# define JNLIB_GCC_M_FUNCTION 1
# define JNLIB_GCC_A_NR __attribute__ ((noreturn))
-# define JNLIB_GCC_A_PRINTF( f, a ) __attribute__ ((format (printf,f,a)))
-# define JNLIB_GCC_A_NR_PRINTF( f, a ) \
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4 )
+# define JNLIB_GCC_A_PRINTF( f, a ) \
+ __attribute__ ((format (__gnu_printf__,f,a)))
+# define JNLIB_GCC_A_NR_PRINTF( f, a ) \
+ __attribute__ ((noreturn, format (__gnu_printf__,f,a)))
+# else
+# define JNLIB_GCC_A_PRINTF( f, a ) __attribute__ ((format (printf,f,a)))
+# define JNLIB_GCC_A_NR_PRINTF( f, a ) \
__attribute__ ((noreturn, format (printf,f,a)))
+# endif
#else
# define JNLIB_GCC_A_NR
# define JNLIB_GCC_A_PRINTF( f, a )