* configure.in (ATTRIBUTE_FORMAT, ATTRIBUTE_FORMAT_PRINTF): New macros.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Apr 2011 19:59:08 +0000 (12:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Apr 2011 19:59:08 +0000 (12:59 -0700)
ChangeLog
configure.in

index d743801..5caab5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-04-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * configure.in (ATTRIBUTE_FORMAT, ATTRIBUTE_FORMAT_PRINTF): New macros.
+
 2011-04-01  Paul Eggert  <eggert@cs.ucla.edu>
 
        Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
index 77deef8..fef19f2 100644 (file)
@@ -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