]> Savannah Git Hosting - gnulib.git/commitdiff
assert-h: Fix test failure on IRIX 6.5.
authorBruno Haible <bruno@clisp.org>
Wed, 8 Feb 2023 21:31:57 +0000 (22:31 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 8 Feb 2023 21:31:57 +0000 (22:31 +0100)
* m4/assert_h.m4 (gl_ASSERT_H): Ensure that on IRIX, including
<assert.h> after <config.h> actually defines the assert macro.

ChangeLog
m4/assert_h.m4

index 09317e6b89be3ddf059988f13d9f14c35c3d2ffa..3d093609dc319cbe62cf555946c9e8b5f0d4a350 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-08  Bruno Haible  <bruno@clisp.org>
+
+       assert-h: Fix test failure on IRIX 6.5.
+       * m4/assert_h.m4 (gl_ASSERT_H): Ensure that on IRIX, including
+       <assert.h> after <config.h> actually defines the assert macro.
+
 2023-02-07  Paul Eggert  <eggert@cs.ucla.edu>
 
        nullptr: test for compilers at autoconf-time
index 3801452ef0d49093f884e9288a6738598d4057d3..d255855d313f7d7ddde19347aa39b96e4b1067e1 100644 (file)
@@ -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 <assert.h>, 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 <assert.h>
  #undef/**/assert
+ #ifdef __sgi
+  #undef/**/__ASSERT_H__
+ #endif
  /* Solaris 11.4 <assert.h> 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