From 0f3415afeeef8ca61e3b3f679399d163d263ed14 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 8 Feb 2023 22:31:57 +0100 Subject: [PATCH] assert-h: Fix test failure on IRIX 6.5. * m4/assert_h.m4 (gl_ASSERT_H): Ensure that on IRIX, including after actually defines the assert macro. --- ChangeLog | 6 ++++++ m4/assert_h.m4 | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09317e6b89..3d093609dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-02-08 Bruno Haible + + assert-h: Fix test failure on IRIX 6.5. + * m4/assert_h.m4 (gl_ASSERT_H): Ensure that on IRIX, including + after actually defines the assert macro. + 2023-02-07 Paul Eggert nullptr: test for compilers at autoconf-time diff --git a/m4/assert_h.m4 b/m4/assert_h.m4 index 3801452ef0..d255855d31 100644 --- a/m4/assert_h.m4 +++ b/m4/assert_h.m4 @@ -46,10 +46,13 @@ AC_DEFUN([gl_ASSERT_H], gl_NEXT_HEADERS([assert.h])]) dnl The "zz" puts this toward config.h's end, to avoid potential - dnl collisions with other definitions. #undef assert so that - dnl programs are not tempted to use it without specifically - dnl including assert.h. Break the #undef apart with a comment - dnl so that 'configure' does not comment it out. + dnl collisions with other definitions. + dnl #undef assert so that programs are not tempted to use it without + dnl specifically including assert.h. + dnl #undef __ASSERT_H__ so that on IRIX, when programs later include + dnl , this include actually defines assert. + dnl Break the #undef_s apart with a comment so that 'configure' does + dnl not comment them out. AH_VERBATIM([zzstatic_assert], [#if (!defined HAVE_C_STATIC_ASSERT && !defined assert \ && (!defined __cplusplus \ @@ -57,6 +60,9 @@ AC_DEFUN([gl_ASSERT_H], && __GNUG__ < 6 && __clang_major__ < 6))) #include #undef/**/assert + #ifdef __sgi + #undef/**/__ASSERT_H__ + #endif /* Solaris 11.4 defines static_assert as a macro with 2 arguments. We need it also to be invocable with a single argument. */ #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus -- 2.39.5