diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-10-11 18:23:47 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-10-11 18:24:19 -0700 |
commit | 4b60e0722d0a79751f345bd470d07db0d635aa28 (patch) | |
tree | 9ebcaa21ec5f08c0caafc7190daf34ed047f8e1f /lib/regex_internal.h | |
parent | f9d8babe6a28b19c781778c361e45b93f7a01f17 (diff) | |
download | emacs-4b60e0722d0a79751f345bd470d07db0d635aa28.tar.gz |
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.h | 30 |
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 @@ #ifndef _REGEX_INTERNAL_H #define _REGEX_INTERNAL_H 1 -#include <assert.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> @@ -34,6 +33,14 @@ #include <stdint.h> #include <intprops.h> +#include <verify.h> + +#if defined DEBUG && DEBUG != 0 +# include <assert.h> +# define DEBUG_ASSERT(x) assert (x) +#else +# define DEBUG_ASSERT(x) assume (x) +#endif #ifdef _LIBC # include <libc-lock.h> @@ -44,22 +51,7 @@ # define lock_unlock(lock) __libc_lock_unlock (lock) #elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO # include "glthread/lock.h" - /* Use gl_lock_define if empty macro arguments are known to work. - Otherwise, fall back on less-portable substitutes. */ -# if ((defined __GNUC__ && !defined __STRICT_ANSI__) \ - || (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__)) -# define lock_define(name) gl_lock_define (, name) -# elif USE_POSIX_THREADS -# define lock_define(name) pthread_mutex_t name; -# elif USE_PTH_THREADS -# define lock_define(name) pth_mutex_t name; -# elif USE_SOLARIS_THREADS -# define lock_define(name) mutex_t name; -# elif USE_WINDOWS_THREADS -# define lock_define(name) gl_lock_t name; -# else -# define lock_define(name) -# endif +# define lock_define(name) gl_lock_define (, name) # define lock_init(lock) glthread_lock_init (&(lock)) # define lock_fini(lock) glthread_lock_destroy (&(lock)) # define lock_lock(lock) glthread_lock_lock (&(lock)) @@ -618,11 +610,7 @@ typedef struct { /* The string object corresponding to the input string. */ re_string_t input; -#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) const re_dfa_t *const dfa; -#else - const re_dfa_t *dfa; -#endif /* EFLAGS of the argument of regexec. */ int eflags; /* Where the matching ends. */ |