summaryrefslogtreecommitdiff
path: root/lib/regex_internal.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-11-24 09:33:46 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-11-24 09:35:15 -0800
commit64f5221ef20ba6723f2b0d5f8c9b666f46480451 (patch)
treef4b0d4a1a15c817dcc7c536191de07873f79ef1e /lib/regex_internal.h
parentfae096d8028a4a3c855a3f11ee22e3e726e853bb (diff)
downloadgnulib-64f5221ef20ba6723f2b0d5f8c9b666f46480451.tar.gz
regex: merge from glibc
The main change here, imported from Glibc, is for the regex code to stop using nested functions when _LIBC is defined. The intent is for the result to be copied back to Glibc so that the two implementations can resync. * lib/regcomp.c (re_set_fastmap, seek_collating_symbol_entry) (lookup_collation_sequence_value, build_range_exp) (build_collating_symbol): * lib/regexec.c (acquire_init_state_context): Declare with __always_inline instead of with ‘inline __attribute__ ((always_inline))’. * lib/regexec.c (init_word_char): Move uint64_t comment to regex_internal.h. (parse_byte): Change multibyte-detecting arg from re_charset_t * to re_dfa_t const *. All callers changed. (build_range_exp, build_collating_symbol) [!_LIBC]: Change signature to match _LIBC well enough so that the caller can be simplified to assume _LIBC. (parse_bracket_exp): Pull its nested functions seek_collating_symbol_entry, lookup_collation_sequence_value, build_range_exp, build_collating_symbol out to the top level, adding args to pass the information instead of having them access nonlocal vars. Use types in local vars that do not assume glibc. * lib/regex_internal.h: Explain uint64_t etc. here.
Diffstat (limited to 'lib/regex_internal.h')
-rw-r--r--lib/regex_internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index b1bc2ee62f..8493db2701 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -146,6 +146,11 @@
# define __regfree regfree
#endif /* not _LIBC */
+/* Types related to integers. Unless protected by #ifdef _LIBC, the
+ regex code should avoid exact-width types like int32_t and uint64_t
+ as some non-GCC platforms lack them, an issue when this code is
+ used in Gnulib. */
+
#ifndef SSIZE_MAX
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
#endif