2020-12-24 15:48:40 +00:00
|
|
|
# mbstate_t.m4 serial 14
|
2023-01-01 10:31:12 +00:00
|
|
|
dnl Copyright (C) 2000-2002, 2008-2023 Free Software Foundation, Inc.
|
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.
2018-08-06 01:41:20 +00:00
|
|
|
dnl This file is free software; the Free Software Foundation
|
|
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
|
|
dnl with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# From Paul Eggert.
|
|
|
|
|
|
|
|
# BeOS 5 has <wchar.h> but does not define mbstate_t,
|
|
|
|
# so you can't declare an object of that type.
|
|
|
|
# Check for this incompatibility with Standard C.
|
|
|
|
|
|
|
|
# AC_TYPE_MBSTATE_T
|
|
|
|
# -----------------
|
|
|
|
AC_DEFUN([AC_TYPE_MBSTATE_T],
|
|
|
|
[
|
|
|
|
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t],
|
|
|
|
[AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM(
|
|
|
|
[AC_INCLUDES_DEFAULT[
|
2020-12-24 15:48:40 +00:00
|
|
|
#include <wchar.h>]],
|
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.
2018-08-06 01:41:20 +00:00
|
|
|
[[mbstate_t x; return sizeof x;]])],
|
|
|
|
[ac_cv_type_mbstate_t=yes],
|
|
|
|
[ac_cv_type_mbstate_t=no])])
|
|
|
|
if test $ac_cv_type_mbstate_t = yes; then
|
|
|
|
AC_DEFINE([HAVE_MBSTATE_T], [1],
|
|
|
|
[Define to 1 if <wchar.h> declares mbstate_t.])
|
|
|
|
else
|
|
|
|
AC_DEFINE([mbstate_t], [int],
|
|
|
|
[Define to a type if <wchar.h> does not define.])
|
|
|
|
fi
|
|
|
|
])
|