diff options
| author | Paul Eggert | 2018-08-05 18:41:20 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-08-05 19:36:09 -0700 |
| commit | d904cc83f3036db96107a3976cee1a0112547de6 (patch) | |
| tree | 7186eee577f0112462a024368c014819c4055152 /m4/eealloc.m4 | |
| parent | e5652268a993ad9117f7253553c143d60460eb8f (diff) | |
| download | emacs-d904cc83f3036db96107a3976cee1a0112547de6.tar.gz emacs-d904cc83f3036db96107a3976cee1a0112547de6.zip | |
Use Gnulib regex for lib-src
Emacs regular expressions forked from everyone else long ago.
This makes it official and should allow simplification later.
etags.c now uses the glibc regex API, falling back on a
Gnulib-supplied substitute lib/regex.c if necessary.
Emacs proper now uses its own regular expression module.
Although this patch may look dauntingly large, most of it
was generated automatically by admin/merge-gnulib
and contains an exact copy of the glibc regex source,
and the by-hand changes do not grow the Emacs source code.
* admin/merge-gnulib (GNULIB_MODULES): Add regex.
(AVOIDED_MODULES): Add btowc, langinfo, lock, mbrtowc, mbsinit,
nl_langinfo, wchar, wcrtomb, wctype-h.
* lib-src/Makefile.in (regex-emacs.o): Remove; Gnulib does it now.
(etags_deps, etags_libs): Remove regex-emacs.o.
* lib-src/etags.c: Go back to including regex.h.
(add_regex): Use unsigned char translation array,
since glibc regex requires that.
* lib/Makefile.in (not_emacs_OBJECTS, for_emacs_OBJECTS): New macros.
(libegnu_a_OBJECTS): Use them, to avoid building e-regex.o.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c:
* lib/regex_internal.h, lib/regexec.c, m4/builtin-expect.m4:
* m4/eealloc.m4, m4/glibc21.m4, m4/mbstate_t.m4, m4/regex.m4:
New files, copied from Gnulib.
* src/regex-emacs.h, src/conf_post.h:
(RE_TRANSLATE_TYPE, RE_TRANSLATE, RE_TRANSLATE_P):
Move from src/conf_post.h to src/regex-emacs.h,
so that they don’t interfere with compiling lib/regex.c.
Diffstat (limited to 'm4/eealloc.m4')
| -rw-r--r-- | m4/eealloc.m4 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/m4/eealloc.m4 b/m4/eealloc.m4 new file mode 100644 index 00000000000..a5a4e267d8e --- /dev/null +++ b/m4/eealloc.m4 | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | # eealloc.m4 serial 3 | ||
| 2 | dnl Copyright (C) 2003, 2009-2018 Free Software Foundation, Inc. | ||
| 3 | dnl This file is free software; the Free Software Foundation | ||
| 4 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 5 | dnl with or without modifications, as long as this notice is preserved. | ||
| 6 | |||
| 7 | AC_DEFUN([gl_EEALLOC], | ||
| 8 | [ | ||
| 9 | AC_REQUIRE([gl_EEMALLOC]) | ||
| 10 | AC_REQUIRE([gl_EEREALLOC]) | ||
| 11 | ]) | ||
| 12 | |||
| 13 | AC_DEFUN([gl_EEMALLOC], | ||
| 14 | [ | ||
| 15 | _AC_FUNC_MALLOC_IF( | ||
| 16 | [gl_cv_func_malloc_0_nonnull=1], | ||
| 17 | [gl_cv_func_malloc_0_nonnull=0]) | ||
| 18 | AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], [$gl_cv_func_malloc_0_nonnull], | ||
| 19 | [If malloc(0) is != NULL, define this to 1. Otherwise define this | ||
| 20 | to 0.]) | ||
| 21 | ]) | ||
| 22 | |||
| 23 | AC_DEFUN([gl_EEREALLOC], | ||
| 24 | [ | ||
| 25 | _AC_FUNC_REALLOC_IF( | ||
| 26 | [gl_cv_func_realloc_0_nonnull=1], | ||
| 27 | [gl_cv_func_realloc_0_nonnull=0]) | ||
| 28 | AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], [$gl_cv_func_realloc_0_nonnull], | ||
| 29 | [If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this | ||
| 30 | to 0.]) | ||
| 31 | ]) | ||