diff options
author | Bruno Haible <bruno@clisp.org> | 2023-02-11 21:12:00 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-02-11 21:12:00 +0100 |
commit | 8e3b4ac39b421fdd0a9083b6cae06fd6fadd8f63 (patch) | |
tree | 96fc8d696c745f8108a49af1c4cf1364aa04e6ed /lib | |
parent | a4f85089e30f89dcb3c0da59ac8a70115d529f72 (diff) | |
download | gnulib-8e3b4ac39b421fdd0a9083b6cae06fd6fadd8f63.tar.gz |
error-h: Make less fragile.
* lib/error.in.h: Use #include_next if the system has an <error.h>. Use
a split double-inclusion guard.
* m4/error_h.m4 (gl_ERROR_H): Invoke gl_CHECK_NEXT_HEADERS. Set
HAVE_ERROR_H.
* modules/error-h (Makefile.am): Substitute GUARD_PREFIX, HAVE_ERROR_H,
INCLUDE_NEXT, PRAGMA_SYSTEM_HEADER, NEXT_ERROR_H.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/error.in.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/error.in.h b/lib/error.in.h index bfddb011c0..dcb49d1608 100644 --- a/lib/error.in.h +++ b/lib/error.in.h @@ -16,8 +16,19 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ -#ifndef _ERROR_H -#define _ERROR_H 1 +#ifndef _@GUARD_PREFIX@_ERROR_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_ERROR_H@ +# @INCLUDE_NEXT@ @NEXT_ERROR_H@ +#endif + +#ifndef _@GUARD_PREFIX@_ERROR_H +#define _@GUARD_PREFIX@_ERROR_H /* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM. */ #include <stdio.h> @@ -103,4 +114,5 @@ extern int error_one_per_line; } #endif -#endif /* error.h */ +#endif /* _@GUARD_PREFIX@_ERROR_H */ +#endif /* _@GUARD_PREFIX@_ERROR_H */ |