mirror of
git://git.gnupg.org/gnupg.git
synced 2025-06-12 18:11:03 +02:00
gpg,regexp: Use -DREGEXP_PREFIX=gnupg_.
* g10/Makefile.am (AM_CPPFLAGS): Add -DREGEXP_PREFIX=gnupg_ * regexp/Makefile.am (AM_CPPFLAGS): Likewise. * regexp/jimregexp.h (ADD_PREFIX): New. (regcomp, regexec, regerror, regfree): Use ADD_PREFIX. -- GnuPG-bug-id: 7668 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
95d0adfc56
commit
16ee68259d
@ -26,7 +26,7 @@ EXTRA_DIST = distsigkey.gpg \
|
|||||||
t-keydb-get-keyblock.gpg t-stutter-data.asc \
|
t-keydb-get-keyblock.gpg t-stutter-data.asc \
|
||||||
all-tests.scm
|
all-tests.scm
|
||||||
|
|
||||||
AM_CPPFLAGS =
|
AM_CPPFLAGS = -DREGEXP_PREFIX=gnupg_
|
||||||
|
|
||||||
include $(top_srcdir)/am/cmacros.am
|
include $(top_srcdir)/am/cmacros.am
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
noinst_LIBRARIES = libregexp.a
|
noinst_LIBRARIES = libregexp.a
|
||||||
|
|
||||||
AM_CPPFLAGS = -DJIM_REGEXP -DJIM_UTF8 -DUSE_UTF8
|
AM_CPPFLAGS = -DJIM_REGEXP -DJIM_UTF8 -DUSE_UTF8 -DREGEXP_PREFIX=gnupg_
|
||||||
|
|
||||||
AM_CFLAGS =
|
AM_CFLAGS =
|
||||||
|
|
||||||
|
@ -1,6 +1,31 @@
|
|||||||
#ifndef JIMREGEXP_H
|
#ifndef JIMREGEXP_H
|
||||||
#define JIMREGEXP_H
|
#define JIMREGEXP_H
|
||||||
|
|
||||||
|
#ifdef REGEXP_PREFIX
|
||||||
|
/*
|
||||||
|
* An application can specify REGEXP_PREFIX to use the prefix to
|
||||||
|
* regexp routines (regcomp, regexec, regerror and regfree).
|
||||||
|
*
|
||||||
|
* Note that the regexp routines are the ones in the standard C
|
||||||
|
* library. It is no problem to override those routines by an
|
||||||
|
* application (with appropriate care of link order).
|
||||||
|
*
|
||||||
|
* However, use of REGEXP_PREFIX is required when you use
|
||||||
|
* AddressSanitizer (ASan). It doesn't work well, because it tries to
|
||||||
|
* replace regexp routines in the standard C library but actually
|
||||||
|
* replaces this implementation. Since it doesn't know about this
|
||||||
|
* implementation, it's not compatible.
|
||||||
|
*
|
||||||
|
* For example, in the Makefiles of GnuPG, we do specify REGEXP_PREFIX
|
||||||
|
* with "gnupg_".
|
||||||
|
*/
|
||||||
|
#define ADD_PREFIX(name) REGEXP_PREFIX ## name
|
||||||
|
#define regcomp ADD_PREFIX(regcomp)
|
||||||
|
#define regexec ADD_PREFIX(regexec)
|
||||||
|
#define regerror ADD_PREFIX(regerror)
|
||||||
|
#define regfree ADD_PREFIX(regfree)
|
||||||
|
#endif
|
||||||
|
|
||||||
/** regexp(3)-compatible regular expression implementation for Jim.
|
/** regexp(3)-compatible regular expression implementation for Jim.
|
||||||
*
|
*
|
||||||
* See jimregexp.c for details
|
* See jimregexp.c for details
|
||||||
|
Loading…
x
Reference in New Issue
Block a user