From aa18133456139b8ad21b2e83f040bae601bdf98f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 5 Apr 2011 12:59:08 -0700 Subject: [PATCH] * configure.in (ATTRIBUTE_FORMAT, ATTRIBUTE_FORMAT_PRINTF): New macros. --- ChangeLog | 4 ++++ configure.in | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index d7438014f68..5caab5fe8e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-04-05 Paul Eggert + + * configure.in (ATTRIBUTE_FORMAT, ATTRIBUTE_FORMAT_PRINTF): New macros. + 2011-04-01 Paul Eggert Replace 2 copies of readlink code with 1 gnulib version (Bug#8401). diff --git a/configure.in b/configure.in index 77deef8dba5..fef19f27642 100644 --- a/configure.in +++ b/configure.in @@ -3581,6 +3581,20 @@ typedef unsigned size_t; #define EXTERNALLY_VISIBLE #endif +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define ATTRIBUTE_FORMAT(spec) /* empty */ +#endif + +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) +# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ + ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument)) +#else +# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ + ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) +#endif + /* Some versions of GNU/Linux define noinline in their headers. */ #ifdef noinline #undef noinline -- 2.39.2