regex: Make configure test more maintainable.
authorBruno Haible <bruno@clisp.org>
Sat, 26 Oct 2024 18:58:05 +0000 (20:58 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 26 Oct 2024 18:58:05 +0000 (20:58 +0200)
* m4/regex.m4 (gl_REGEX): Include <malloc.h> before testing for
M_CHECK_ACTION.

ChangeLog
m4/regex.m4

index b4736190f50c02356c339a8233b96eb9fcf1abee..a4399d3c8667e3367f4e62912b39336118890b0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-10-26  Bruno Haible  <bruno@clisp.org>
+
+       regex: Make configure test more maintainable.
+       * m4/regex.m4 (gl_REGEX): Include <malloc.h> before testing for
+       M_CHECK_ACTION.
+
 2024-10-26  Bruno Haible  <bruno@clisp.org>
 
        execute, spawn-pipe: Fix compilation error on Cygwin (regr. 2024-10-22).
index 64fa7e914620a0f83add3391290ad9adee0c5ade..18f36804c485c57ccdf5f5e2152d3d9dbc4c2e00 100644 (file)
@@ -1,5 +1,5 @@
 # regex.m4
-# serial 75
+# serial 76
 dnl Copyright (C) 1996-2001, 2003-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -40,15 +40,15 @@ AC_DEFUN([gl_REGEX],
             #include <limits.h>
             #include <string.h>
 
+            #if HAVE_MALLOC_H
+            # include <malloc.h> /* defines M_CHECK_ACTION on glibc */
+            #endif
+
             #if defined M_CHECK_ACTION || HAVE_DECL_ALARM
             # include <signal.h>
             # include <unistd.h>
             #endif
 
-            #if HAVE_MALLOC_H
-            # include <malloc.h>
-            #endif
-
             #ifdef M_CHECK_ACTION
             /* Exit with distinguishable exit code.  */
             static void sigabrt_no_core (int sig) { raise (SIGTERM); }