aboutsummaryrefslogtreecommitdiffstats
path: root/lib/regex_internal.h
diff options
context:
space:
mode:
authorPaul Eggert2019-10-11 18:23:47 -0700
committerPaul Eggert2019-10-11 18:24:19 -0700
commit4b60e0722d0a79751f345bd470d07db0d635aa28 (patch)
tree9ebcaa21ec5f08c0caafc7190daf34ed047f8e1f /lib/regex_internal.h
parentf9d8babe6a28b19c781778c361e45b93f7a01f17 (diff)
downloademacs-4b60e0722d0a79751f345bd470d07db0d635aa28.tar.gz
emacs-4b60e0722d0a79751f345bd470d07db0d635aa28.zip
Update from Gnulib
This incorporates: 2019-10-11 Simplify and regularize regex use of ‘assert’ 2019-10-09 regex: omit debug assignment when not debugging 2019-10-09 regex: tell compiler there’s at most 256 arcs out 2019-10-09 regex: simplify by assuming C99 2019-10-09 regex: avoid copying of uninitialized storage 2019-09-29 fbufmode: Fix compilation error on glibc >= 2.28 systems 2019-09-28 Update comments that refer to POSIX 2019-09-23 Update URLs and associated text * doc/misc/texinfo.tex, lib/open.c, lib/regcomp.c: * lib/regex_internal.c, lib/regex_internal.h, lib/regexec.c: * lib/stdio-impl.h: Copy from Gnulib.
Diffstat (limited to 'lib/regex_internal.h')
-rw-r--r--lib/regex_internal.h30
1 files changed, 9 insertions, 21 deletions
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index a3aedda8915..ccac8f13133 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -20,7 +20,6 @@
20#ifndef _REGEX_INTERNAL_H 20#ifndef _REGEX_INTERNAL_H
21#define _REGEX_INTERNAL_H 1 21#define _REGEX_INTERNAL_H 1
22 22
23#include <assert.h>
24#include <ctype.h> 23#include <ctype.h>
25#include <stdio.h> 24#include <stdio.h>
26#include <stdlib.h> 25#include <stdlib.h>
@@ -34,6 +33,14 @@
34#include <stdint.h> 33#include <stdint.h>
35 34
36#include <intprops.h> 35#include <intprops.h>
36#include <verify.h>
37
38#if defined DEBUG && DEBUG != 0
39# include <assert.h>
40# define DEBUG_ASSERT(x) assert (x)
41#else
42# define DEBUG_ASSERT(x) assume (x)
43#endif
37 44
38#ifdef _LIBC 45#ifdef _LIBC
39# include <libc-lock.h> 46# include <libc-lock.h>
@@ -44,22 +51,7 @@
44# define lock_unlock(lock) __libc_lock_unlock (lock) 51# define lock_unlock(lock) __libc_lock_unlock (lock)
45#elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO 52#elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO
46# include "glthread/lock.h" 53# include "glthread/lock.h"
47 /* Use gl_lock_define if empty macro arguments are known to work. 54# define lock_define(name) gl_lock_define (, name)
48 Otherwise, fall back on less-portable substitutes. */
49# if ((defined __GNUC__ && !defined __STRICT_ANSI__) \
50 || (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__))
51# define lock_define(name) gl_lock_define (, name)
52# elif USE_POSIX_THREADS
53# define lock_define(name) pthread_mutex_t name;
54# elif USE_PTH_THREADS
55# define lock_define(name) pth_mutex_t name;
56# elif USE_SOLARIS_THREADS
57# define lock_define(name) mutex_t name;
58# elif USE_WINDOWS_THREADS
59# define lock_define(name) gl_lock_t name;
60# else
61# define lock_define(name)
62# endif
63# define lock_init(lock) glthread_lock_init (&(lock)) 55# define lock_init(lock) glthread_lock_init (&(lock))
64# define lock_fini(lock) glthread_lock_destroy (&(lock)) 56# define lock_fini(lock) glthread_lock_destroy (&(lock))
65# define lock_lock(lock) glthread_lock_lock (&(lock)) 57# define lock_lock(lock) glthread_lock_lock (&(lock))
@@ -618,11 +610,7 @@ typedef struct
618{ 610{
619 /* The string object corresponding to the input string. */ 611 /* The string object corresponding to the input string. */
620 re_string_t input; 612 re_string_t input;
621#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
622 const re_dfa_t *const dfa; 613 const re_dfa_t *const dfa;
623#else
624 const re_dfa_t *dfa;
625#endif
626 /* EFLAGS of the argument of regexec. */ 614 /* EFLAGS of the argument of regexec. */
627 int eflags; 615 int eflags;
628 /* Where the matching ends. */ 616 /* Where the matching ends. */