diff options
Diffstat (limited to 'gl/strerror-override.h')
| -rw-r--r-- | gl/strerror-override.h | 73 |
1 files changed, 44 insertions, 29 deletions
diff --git a/gl/strerror-override.h b/gl/strerror-override.h index 388cc282..a1734a24 100644 --- a/gl/strerror-override.h +++ b/gl/strerror-override.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* strerror-override.h --- POSIX compatible system error routine | 1 | /* strerror-override.h --- POSIX compatible system error routine |
| 2 | 2 | ||
| 3 | Copyright (C) 2010-2023 Free Software Foundation, Inc. | 3 | Copyright (C) 2010-2024 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is free software: you can redistribute it and/or modify | 5 | This file is free software: you can redistribute it and/or modify |
| 6 | it under the terms of the GNU Lesser General Public License as | 6 | it under the terms of the GNU Lesser General Public License as |
| @@ -16,42 +16,57 @@ | |||
| 16 | along with this program. If not, see <https://www.gnu.org/licenses/>. */ | 16 | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
| 17 | 17 | ||
| 18 | #ifndef _GL_STRERROR_OVERRIDE_H | 18 | #ifndef _GL_STRERROR_OVERRIDE_H |
| 19 | # define _GL_STRERROR_OVERRIDE_H | 19 | #define _GL_STRERROR_OVERRIDE_H |
| 20 | |||
| 21 | /* This file uses _GL_ATTRIBUTE_CONST. */ | ||
| 22 | #if !_GL_CONFIG_H_INCLUDED | ||
| 23 | # error "Please include config.h first." | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #include <errno.h> | ||
| 27 | #include <stddef.h> | ||
| 28 | |||
| 29 | #ifdef __cplusplus | ||
| 30 | extern "C" { | ||
| 31 | #endif | ||
| 20 | 32 | ||
| 21 | # include <errno.h> | ||
| 22 | # include <stddef.h> | ||
| 23 | 33 | ||
| 24 | /* Reasonable buffer size that should never trigger ERANGE; if this | 34 | /* Reasonable buffer size that should never trigger ERANGE; if this |
| 25 | proves too small, we intentionally abort(), to remind us to fix | 35 | proves too small, we intentionally abort(), to remind us to fix |
| 26 | this value. */ | 36 | this value. */ |
| 27 | # define STACKBUF_LEN 256 | 37 | #define STACKBUF_LEN 256 |
| 28 | 38 | ||
| 29 | /* If ERRNUM maps to an errno value defined by gnulib, return a string | 39 | /* If ERRNUM maps to an errno value defined by gnulib, return a string |
| 30 | describing the error. Otherwise return NULL. */ | 40 | describing the error. Otherwise return NULL. */ |
| 31 | # if REPLACE_STRERROR_0 \ | 41 | #if REPLACE_STRERROR_0 \ |
| 32 | || GNULIB_defined_ESOCK \ | 42 | || GNULIB_defined_ESOCK \ |
| 33 | || GNULIB_defined_ESTREAMS \ | 43 | || GNULIB_defined_ESTREAMS \ |
| 34 | || GNULIB_defined_EWINSOCK \ | 44 | || GNULIB_defined_EWINSOCK \ |
| 35 | || GNULIB_defined_ENOMSG \ | 45 | || GNULIB_defined_ENOMSG \ |
| 36 | || GNULIB_defined_EIDRM \ | 46 | || GNULIB_defined_EIDRM \ |
| 37 | || GNULIB_defined_ENOLINK \ | 47 | || GNULIB_defined_ENOLINK \ |
| 38 | || GNULIB_defined_EPROTO \ | 48 | || GNULIB_defined_EPROTO \ |
| 39 | || GNULIB_defined_EMULTIHOP \ | 49 | || GNULIB_defined_EMULTIHOP \ |
| 40 | || GNULIB_defined_EBADMSG \ | 50 | || GNULIB_defined_EBADMSG \ |
| 41 | || GNULIB_defined_EOVERFLOW \ | 51 | || GNULIB_defined_EOVERFLOW \ |
| 42 | || GNULIB_defined_ENOTSUP \ | 52 | || GNULIB_defined_ENOTSUP \ |
| 43 | || GNULIB_defined_ENETRESET \ | 53 | || GNULIB_defined_ENETRESET \ |
| 44 | || GNULIB_defined_ECONNABORTED \ | 54 | || GNULIB_defined_ECONNABORTED \ |
| 45 | || GNULIB_defined_ESTALE \ | 55 | || GNULIB_defined_ESTALE \ |
| 46 | || GNULIB_defined_EDQUOT \ | 56 | || GNULIB_defined_EDQUOT \ |
| 47 | || GNULIB_defined_ECANCELED \ | 57 | || GNULIB_defined_ECANCELED \ |
| 48 | || GNULIB_defined_EOWNERDEAD \ | 58 | || GNULIB_defined_EOWNERDEAD \ |
| 49 | || GNULIB_defined_ENOTRECOVERABLE \ | 59 | || GNULIB_defined_ENOTRECOVERABLE \ |
| 50 | || GNULIB_defined_EILSEQ | 60 | || GNULIB_defined_EILSEQ |
| 51 | extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST; | 61 | extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST; |
| 52 | # else | 62 | #else |
| 53 | # define strerror_override(ignored) NULL | 63 | # define strerror_override(ignored) NULL |
| 54 | # define GNULIB_defined_strerror_override_macro 1 | 64 | # define GNULIB_defined_strerror_override_macro 1 |
| 55 | # endif | 65 | #endif |
| 66 | |||
| 67 | |||
| 68 | #ifdef __cplusplus | ||
| 69 | } | ||
| 70 | #endif | ||
| 56 | 71 | ||
| 57 | #endif /* _GL_STRERROR_OVERRIDE_H */ | 72 | #endif /* _GL_STRERROR_OVERRIDE_H */ |
