Hi,
On 24/01/2019 15:48, Julian Andres Klode wrote:
How is it inherited?
In pcre2, the names are overriden in debian/rules, and any application wishing to
make use of it has to add the same definitions:
Huh, yes. Bother.
I think the attached patch does the right thing now?
[past-me clearly screwed this up once, so I'd appreciate another pair of
eyes on it this time :-/ ]
Regards,
Matthew
diff --git a/debian/README.Debian b/debian/README.Debian
index 8c23e75..6b4a336 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -6,7 +6,7 @@ expression) library. New projects should use this library in
preference the older PCRE library (which is, for historical reasons,
called pcre3 in Debian).
-The names of functions in libpcre2-posix are prefixed with PCRE2_, so
+The names of functions in libpcre2-posix are prefixed with PCRE2, so
they don't clash with the names in libc.
- -- Matthew Vernon <[email protected]>, Sun, 22 Nov 2015 16:07:27 +0000
+ -- Matthew Vernon <[email protected]>, Sun, 27 Jan 2019 13:55:17 +0000
diff --git a/debian/changelog b/debian/changelog
index 634d436..5894999 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+pcre2 (10.32-5) unstable; urgency=medium
+
+ * Properly provide prefixed function names in libpcre2-posix (thanks to
+ Julian Andres Klode for the report) (Closes: #920290)
+
+ -- Matthew Vernon <[email protected]> Sun, 27 Jan 2019 13:56:43 +0000
+
pcre2 (10.32-4) unstable; urgency=medium
* Take patch from Jeremy Bicha to build with
diff --git a/debian/rules b/debian/rules
index a68760a..ddb47e5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,6 @@ DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
# prefix names of functions in libpcreposix with PCRE2 to avoid clash with
# ones in libc.
-export DEB_CFLAGS_MAINT_APPEND = -Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree
deb_maint_conf_args = --enable-pcre2-16 --enable-pcre2-32 --disable-pcre2grep-callout
diff --git a/src/pcre2posix.h b/src/pcre2posix.h
index 4ae1d3c..3aa28c5 100644
--- a/src/pcre2posix.h
+++ b/src/pcre2posix.h
@@ -138,14 +138,19 @@ file. */
/* The functions */
-PCRE2POSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
-PCRE2POSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
+PCRE2POSIX_EXP_DECL int PCRE2regcomp(regex_t *, const char *, int);
+PCRE2POSIX_EXP_DECL int PCRE2regexec(const regex_t *, const char *, size_t,
regmatch_t *, int);
-PCRE2POSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
-PCRE2POSIX_EXP_DECL void regfree(regex_t *);
+PCRE2POSIX_EXP_DECL size_t PCRE2regerror(int, const regex_t *, char *, size_t);
+PCRE2POSIX_EXP_DECL void PCRE2regfree(regex_t *);
#ifdef __cplusplus
} /* extern "C" */
#endif
+#define regcomp PCRE2regcomp
+#define regexec PCRE2regexec
+#define regerror PCRE2regerror
+#define regfree PCRE2regfree
+
/* End of pcre2posix.h */