summaryrefslogtreecommitdiff
path: root/gnulib/tests/error.h
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib/tests/error.h')
-rw-r--r--gnulib/tests/error.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/gnulib/tests/error.h b/gnulib/tests/error.h
index ccffef585..eb4fb7017 100644
--- a/gnulib/tests/error.h
+++ b/gnulib/tests/error.h
@@ -31,6 +31,16 @@
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
+/* On mingw, the flavor of printf depends on whether the extensions module
+ * is in use; the check for <stdio.h> determines the witness macro. */
+#ifndef _GL_ATTRIBUTE_SPEC_PRINTF
+# if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+# define _GL_ATTRIBUTE_SPEC_PRINTF __gnu_printf__
+# else
+# define _GL_ATTRIBUTE_SPEC_PRINTF __printf__
+# endif
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -40,11 +50,11 @@ extern "C" {
If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
extern void error (int __status, int __errnum, const char *__format, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 3, 4));
extern void error_at_line (int __status, int __errnum, const char *__fname,
unsigned int __lineno, const char *__format, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 5, 6));
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 5, 6));
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this