diff options
| author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-08-19 23:27:12 +0200 |
|---|---|---|
| committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-08-19 23:27:12 +0200 |
| commit | 26fbe7f1e68bb0c96da32491efcf3696fe6c299b (patch) | |
| tree | c4d95289187a64e9c7517bf73d8208026c3d2fb3 /gl/error.h | |
| parent | 5f79e3e9f62ca5487d9881973149136ba1d19d3e (diff) | |
| download | monitoring-plugins-26fbe7f1e68bb0c96da32491efcf3696fe6c299b.tar.gz | |
Sync with the latest Gnulib code (6f2d632)
Diffstat (limited to 'gl/error.h')
| -rw-r--r-- | gl/error.h | 24 |
1 files changed, 12 insertions, 12 deletions
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Declaration for error-reporting function | 1 | /* Declaration for error-reporting function |
| 2 | Copyright (C) 1995, 1996, 1997, 2003, 2006, 2008, 2009, 2010 Free Software | 2 | Copyright (C) 1995-1997, 2003, 2006, 2008-2013 Free Software Foundation, |
| 3 | Foundation, Inc. | 3 | Inc. |
| 4 | This file is part of the GNU C Library. | 4 | This file is part of the GNU C Library. |
| 5 | 5 | ||
| 6 | This program is free software: you can redistribute it and/or modify | 6 | This program is free software: you can redistribute it and/or modify |
| @@ -19,39 +19,39 @@ | |||
| 19 | #ifndef _ERROR_H | 19 | #ifndef _ERROR_H |
| 20 | #define _ERROR_H 1 | 20 | #define _ERROR_H 1 |
| 21 | 21 | ||
| 22 | #ifndef __attribute__ | ||
| 23 | /* The __attribute__ feature is available in gcc versions 2.5 and later. | 22 | /* The __attribute__ feature is available in gcc versions 2.5 and later. |
| 24 | The __-protected variants of the attributes 'format' and 'printf' are | 23 | The __-protected variants of the attributes 'format' and 'printf' are |
| 25 | accepted by gcc versions 2.6.4 (effectively 2.7) and later. | 24 | accepted by gcc versions 2.6.4 (effectively 2.7) and later. |
| 26 | We enable __attribute__ only if these are supported too, because | 25 | We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because |
| 27 | gnulib and libintl do '#define printf __printf__' when they override | 26 | gnulib and libintl do '#define printf __printf__' when they override |
| 28 | the 'printf' function. */ | 27 | the 'printf' function. */ |
| 29 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) | 28 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) |
| 30 | # define __attribute__(Spec) /* empty */ | 29 | # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) |
| 31 | # endif | 30 | #else |
| 31 | # define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ | ||
| 32 | #endif | 32 | #endif |
| 33 | 33 | ||
| 34 | #ifdef __cplusplus | 34 | #ifdef __cplusplus |
| 35 | extern "C" { | 35 | extern "C" { |
| 36 | #endif | 36 | #endif |
| 37 | 37 | ||
| 38 | /* Print a message with `fprintf (stderr, FORMAT, ...)'; | 38 | /* Print a message with 'fprintf (stderr, FORMAT, ...)'; |
| 39 | if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). | 39 | if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). |
| 40 | If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ | 40 | If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */ |
| 41 | 41 | ||
| 42 | extern void error (int __status, int __errnum, const char *__format, ...) | 42 | extern void error (int __status, int __errnum, const char *__format, ...) |
| 43 | __attribute__ ((__format__ (__printf__, 3, 4))); | 43 | _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4)); |
| 44 | 44 | ||
| 45 | extern void error_at_line (int __status, int __errnum, const char *__fname, | 45 | extern void error_at_line (int __status, int __errnum, const char *__fname, |
| 46 | unsigned int __lineno, const char *__format, ...) | 46 | unsigned int __lineno, const char *__format, ...) |
| 47 | __attribute__ ((__format__ (__printf__, 5, 6))); | 47 | _GL_ATTRIBUTE_FORMAT ((__printf__, 5, 6)); |
| 48 | 48 | ||
| 49 | /* If NULL, error will flush stdout, then print on stderr the program | 49 | /* If NULL, error will flush stdout, then print on stderr the program |
| 50 | name, a colon and a space. Otherwise, error will call this | 50 | name, a colon and a space. Otherwise, error will call this |
| 51 | function without parameters instead. */ | 51 | function without parameters instead. */ |
| 52 | extern void (*error_print_progname) (void); | 52 | extern void (*error_print_progname) (void); |
| 53 | 53 | ||
| 54 | /* This variable is incremented each time `error' is called. */ | 54 | /* This variable is incremented each time 'error' is called. */ |
| 55 | extern unsigned int error_message_count; | 55 | extern unsigned int error_message_count; |
| 56 | 56 | ||
| 57 | /* Sometimes we want to have at most one error per line. This | 57 | /* Sometimes we want to have at most one error per line. This |
