diff options
Diffstat (limited to 'gl/m4/regex.m4')
| -rw-r--r-- | gl/m4/regex.m4 | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4 index f0101fe6..49a8059f 100644 --- a/gl/m4/regex.m4 +++ b/gl/m4/regex.m4 | |||
| @@ -1,9 +1,10 @@ | |||
| 1 | # regex.m4 | 1 | # regex.m4 |
| 2 | # serial 75 | 2 | # serial 81 |
| 3 | dnl Copyright (C) 1996-2001, 2003-2024 Free Software Foundation, Inc. | 3 | dnl Copyright (C) 1996-2001, 2003-2025 Free Software Foundation, Inc. |
| 4 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
| 5 | dnl gives unlimited permission to copy and/or distribute it, | 5 | dnl gives unlimited permission to copy and/or distribute it, |
| 6 | dnl with or without modifications, as long as this notice is preserved. | 6 | dnl with or without modifications, as long as this notice is preserved. |
| 7 | dnl This file is offered as-is, without any warranty. | ||
| 7 | 8 | ||
| 8 | dnl Initially derived from code in GNU grep. | 9 | dnl Initially derived from code in GNU grep. |
| 9 | dnl Mostly written by Jim Meyering. | 10 | dnl Mostly written by Jim Meyering. |
| @@ -39,19 +40,24 @@ AC_DEFUN([gl_REGEX], | |||
| 39 | #include <limits.h> | 40 | #include <limits.h> |
| 40 | #include <string.h> | 41 | #include <string.h> |
| 41 | 42 | ||
| 42 | #if defined M_CHECK_ACTION || HAVE_DECL_ALARM | 43 | #if HAVE_MALLOC_H |
| 43 | # include <signal.h> | 44 | # include <malloc.h> /* defines M_CHECK_ACTION on glibc */ |
| 44 | # include <unistd.h> | ||
| 45 | #endif | 45 | #endif |
| 46 | 46 | ||
| 47 | #if HAVE_MALLOC_H | 47 | #if defined __HAIKU__ || defined M_CHECK_ACTION || HAVE_DECL_ALARM |
| 48 | # include <malloc.h> | 48 | # include <signal.h> |
| 49 | # include <unistd.h> | ||
| 49 | #endif | 50 | #endif |
| 50 | 51 | ||
| 51 | #ifdef M_CHECK_ACTION | 52 | #if defined __HAIKU__ || defined M_CHECK_ACTION |
| 52 | /* Exit with distinguishable exit code. */ | 53 | /* Exit with distinguishable exit code. */ |
| 53 | static void sigabrt_no_core (int sig) { raise (SIGTERM); } | 54 | static void sigabrt_no_core (int sig) { raise (SIGTERM); } |
| 54 | #endif | 55 | #endif |
| 56 | |||
| 57 | /* There is no need to check whether RE_SYNTAX_EMACS is | ||
| 58 | (RE_CHAR_CLASSES | RE_INTERVALS), corresponding to | ||
| 59 | Emacs 21 (2001) and later, because Gnulib's lib/regex.h | ||
| 60 | is always used and has this value. */ | ||
| 55 | ]], | 61 | ]], |
| 56 | [[int result = 0; | 62 | [[int result = 0; |
| 57 | static struct re_pattern_buffer regex; | 63 | static struct re_pattern_buffer regex; |
| @@ -67,6 +73,9 @@ AC_DEFUN([gl_REGEX], | |||
| 67 | signal (SIGALRM, SIG_DFL); | 73 | signal (SIGALRM, SIG_DFL); |
| 68 | alarm (2); | 74 | alarm (2); |
| 69 | #endif | 75 | #endif |
| 76 | #ifdef __HAIKU__ | ||
| 77 | signal (SIGABRT, sigabrt_no_core); | ||
| 78 | #endif | ||
| 70 | #ifdef M_CHECK_ACTION | 79 | #ifdef M_CHECK_ACTION |
| 71 | signal (SIGABRT, sigabrt_no_core); | 80 | signal (SIGABRT, sigabrt_no_core); |
| 72 | mallopt (M_CHECK_ACTION, 2); | 81 | mallopt (M_CHECK_ACTION, 2); |
| @@ -388,7 +397,6 @@ AC_DEFUN([gl_PREREQ_REGEX], | |||
| 388 | AC_REQUIRE([AC_C_INLINE]) | 397 | AC_REQUIRE([AC_C_INLINE]) |
| 389 | AC_REQUIRE([AC_C_RESTRICT]) | 398 | AC_REQUIRE([AC_C_RESTRICT]) |
| 390 | AC_REQUIRE([AC_TYPE_MBSTATE_T]) | 399 | AC_REQUIRE([AC_TYPE_MBSTATE_T]) |
| 391 | AC_REQUIRE([gl_EEMALLOC]) | ||
| 392 | AC_CHECK_HEADERS([libintl.h]) | 400 | AC_CHECK_HEADERS([libintl.h]) |
| 393 | AC_CHECK_FUNCS_ONCE([isblank iswctype]) | 401 | AC_CHECK_FUNCS_ONCE([isblank iswctype]) |
| 394 | AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]]) | 402 | AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]]) |
