2024-11-05 Paul Eggert <eggert@cs.ucla.edu>
+ regex: port better to AIX extensions
+ Also, switch from eealloc.m4 to malloc.m4 to determine
+ whether malloc (0) returns nonnull.
+ * lib/regex_internal.c (re_node_set_alloc):
+ Remove special case for malloc (0).
+ * lib/regex_internal.h (MALLOC_0_IS_NONNULL): Remove.
+ * m4/regex.m4 (gl_PREREQ_REGEX): Do not require gl_EEMALLOC.
+ * modules/regex (Files): Remove m4/eealloc.m4, m4/malloc.m4.
+ (Depends-on): Add malloc-gnu.
+
malloca: port better to AIX extensions
Also, switch from eealloc.m4 to malloc.m4 to determine
whether malloc (0) returns nonnull.
set->alloc = size;
set->nelem = 0;
set->elems = re_malloc (Idx, size);
- if (__glibc_unlikely (set->elems == NULL)
- && (MALLOC_0_IS_NONNULL || size != 0))
+ if (__glibc_unlikely (set->elems == NULL))
return REG_ESPACE;
return REG_NOERROR;
}
#define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
#define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
-#ifdef _LIBC
-# define MALLOC_0_IS_NONNULL 1
-#elif !defined MALLOC_0_IS_NONNULL
-# define MALLOC_0_IS_NONNULL 0
-#endif
-
#ifndef MAX
# define MAX(a,b) ((a) < (b) ? (b) : (a))
#endif
# regex.m4
-# serial 77
+# serial 78
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,
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([AC_TYPE_MBSTATE_T])
- AC_REQUIRE([gl_EEMALLOC])
AC_CHECK_HEADERS([libintl.h])
AC_CHECK_FUNCS_ONCE([isblank iswctype])
AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
lib/regex_internal.h
lib/regexec.c
lib/regcomp.c
-m4/eealloc.m4
-m4/malloc.m4
m4/regex.m4
m4/mbstate_t.m4
libc-config [test $ac_use_included_regex = yes]
limits-h [test $ac_use_included_regex = yes]
lock [test $ac_use_included_regex = yes]
+malloc-gnu [test $ac_use_included_regex = yes]
memcmp [test $ac_use_included_regex = yes]
memmove [test $ac_use_included_regex = yes]
mbrtowc [test $ac_use_included_regex = yes]