summaryrefslogtreecommitdiff
path: root/tests/error.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/error.in.h')
-rw-r--r--tests/error.in.h63
1 files changed, 54 insertions, 9 deletions
diff --git a/tests/error.in.h b/tests/error.in.h
index 51f8cafd..4804c8c4 100644
--- a/tests/error.in.h
+++ b/tests/error.in.h
@@ -23,19 +23,22 @@
or error_at_line(...) invocations. */
/* The include_next requires a split double-inclusion guard. */
-#if @HAVE_ERROR_H@
+#if @HAVE_ERROR_H@ && !defined __MINGW32__
# @INCLUDE_NEXT@ @NEXT_ERROR_H@
#endif
#ifndef _@GUARD_PREFIX@_ERROR_H
#define _@GUARD_PREFIX@_ERROR_H
-/* This file uses _GL_ATTRIBUTE_ALWAYS_INLINE, _GL_ATTRIBUTE_FORMAT,
- _GL_ATTRIBUTE_MAYBE_UNUSED. */
+/* This file uses _GL_ATTRIBUTE_ALWAYS_INLINE, _GL_ATTRIBUTE_COLD,
+ _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_MAYBE_UNUSED. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
+/* Get va_list. */
+#include <stdarg.h>
+
/* Get 'unreachable'. */
#include <stddef.h>
@@ -92,7 +95,8 @@ extern "C" {
# define error rpl_error
# endif
_GL_FUNCDECL_RPL (error, void,
- (int __status, int __errnum, const char *__format, ...)
+ (int __status, int __errnum, const char *__format, ...),
+ _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3, 4)));
_GL_CXXALIAS_RPL (error, void,
(int __status, int __errnum, const char *__format, ...));
@@ -104,7 +108,8 @@ _GL_CXXALIAS_RPL (error, void,
#else
# if ! @HAVE_ERROR@
_GL_FUNCDECL_SYS (error, void,
- (int __status, int __errnum, const char *__format, ...)
+ (int __status, int __errnum, const char *__format, ...),
+ _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3, 4)));
# endif
_GL_CXXALIAS_SYS (error, void,
@@ -117,7 +122,7 @@ _GL_CXXALIAS_SYS (error, void,
# pragma GCC diagnostic ignored "-Wattributes"
_GL_ATTRIBUTE_MAYBE_UNUSED
static void
-_GL_ATTRIBUTE_ALWAYS_INLINE
+_GL_ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3, 4))
_gl_inline_error (int __status, int __errnum, const char *__format, ...)
{
@@ -147,7 +152,8 @@ _GL_CXXALIASWARN (error);
# endif
_GL_FUNCDECL_RPL (error_at_line, void,
(int __status, int __errnum, const char *__filename,
- unsigned int __lineno, const char *__format, ...)
+ unsigned int __lineno, const char *__format, ...),
+ _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5, 6)));
_GL_CXXALIAS_RPL (error_at_line, void,
(int __status, int __errnum, const char *__filename,
@@ -161,7 +167,8 @@ _GL_CXXALIAS_RPL (error_at_line, void,
# if ! @HAVE_ERROR_AT_LINE@
_GL_FUNCDECL_SYS (error_at_line, void,
(int __status, int __errnum, const char *__filename,
- unsigned int __lineno, const char *__format, ...)
+ unsigned int __lineno, const char *__format, ...),
+ _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5, 6)));
# endif
_GL_CXXALIAS_SYS (error_at_line, void,
@@ -175,7 +182,7 @@ _GL_CXXALIAS_SYS (error_at_line, void,
# pragma GCC diagnostic ignored "-Wattributes"
_GL_ATTRIBUTE_MAYBE_UNUSED
static void
-_GL_ATTRIBUTE_ALWAYS_INLINE
+_GL_ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_COLD
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5, 6))
_gl_inline_error_at_line (int __status, int __errnum, const char *__filename,
unsigned int __lineno, const char *__format, ...)
@@ -196,6 +203,44 @@ _gl_inline_error_at_line (int __status, int __errnum, const char *__filename,
#endif
_GL_CXXALIASWARN (error_at_line);
+/* Print a message with 'vfprintf (stderr, FORMAT, ARGS)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'.
+ Use the globals error_print_progname and error_message_count similarly
+ to error(). */
+
+extern void verror (int __status, int __errnum, const char *__format,
+ va_list __args)
+ _GL_ATTRIBUTE_COLD
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
+#ifndef _GL_NO_INLINE_ERROR
+# ifndef verror
+# define verror(status, ...) \
+ __gl_error_call (verror, status, __VA_ARGS__)
+# define GNULIB_defined_verror 1
+# endif
+#endif
+
+/* Print a message with 'vfprintf (stderr, FORMAT, ARGS)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'.
+ If FNAME is not NULL, prepend the message with "FNAME:LINENO:".
+ Use the globals error_print_progname, error_message_count, and
+ error_one_per_line similarly to error_at_line(). */
+
+extern void verror_at_line (int __status, int __errnum, const char *__fname,
+ unsigned int __lineno, const char *__format,
+ va_list __args)
+ _GL_ATTRIBUTE_COLD
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 0));
+#ifdef _GL_NO_INLINE_ERROR
+# ifndef verror_at_line
+# define verror_at_line(status, ...) \
+ __gl_error_call (verror_at_line, status, __VA_ARGS__)
+# define GNULIB_defined_verror_at_line 1
+# endif
+#endif
+
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */