Re: [pcre-dev] Mingw Memory mismatch problem

Páxina inicial
Borrar esta mensaxe
Autor: Philip Hazel
Data:  
Para: Bob Rossi
CC: pcre-dev, Brian Dessent
Asunto: Re: [pcre-dev] Mingw Memory mismatch problem
On Wed, 4 Apr 2007, Bob Rossi wrote:

> An hour!??! Make it 45 minutes!!!
>
> Can't wait to test it out. :)


OK, I've put what I have done in

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/pcre-7.1-RC4.tar.gz
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/pcre-7.1-RC4.tar.bz2
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/pcre-7.1-RC4.zip

Part of the problem seemed to be that we were using a single macro,
PCRE_DATA_SCOPE for everything. I have now created three different
macros:

PCRE_EXP_DECL       for declarations
PCRE_EXP_DEFN       for function definitions
PCRE_EXP_DATA_DEFN  for variable definitions such as pcre_malloc.


The need for separating the second two is that you *don't* want an
"extern" setting for PCRE_EXP_DATA_DEFN in Linux as otherwise you get a
compiler warning from lines like

PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = malloc;

In Windows, the 2nd and 3rd should always be the same.

I have arranged that pcre.h contains only the DECL setting, as it is for
use by applications, which aren't doing any definition. It sets it up
for importing. The DEFN settings, and a DECL setting for exporting, are
in pcre_internal.h. I put a fairly long comment in there about all of
this, including a link to a MS web page.

Cunningly, each of these does the setting only if DECL is not already
set. This means that pcre_internal.h can #include pcre.h, and not have
its setting overridden. Even more cunningly, pcretest.c, which is an
application but wants to peek into the internals, can #include pcre.h
and then pcre_internal.h.

For pcreposix I did something similar with PCREPOSIX_EXP_xxx, though
only two macros are needed there. As there isn't a separate "internal"
header, and no export declarations are needed, I just did them both in
pcreposix.h.

I have *not* made any changes to the C++ files, though Charles Wilson
suggests that a change is necessary. I thought I'd see if this worked
first.

OTHER CHANGES IN THE -RC4 RELEASE

1. Renamed the -c and -l files to _c and _l as requested (for makevp).

2. Removed configure, Makefile.in, INSTALL from the svn.

3. COPYING now references LICENCE instead of being a copy of it.

4. I applied Daniel's patches, as per his message, for CMake and other
changes.

5. Fixed RunGrepTest by running it in srcdir so the file names that
pcregrep outputs are stable.

6. Added something about "fr_FR" vs "french" locales to some of the
docs.

7. Ensured that maint/ManyConfigTests now does at least one test build
in a non-source directory (/tmp/pcretesting).

8. Fixed a buglet in pcregrep - in some error cases it could try to free
undefined memory.

9. Fixed the pcretest /g bug that Sheri reported (match at end of line
when newline=and and line ends with CRLF).

It builds and passes all the tests on Linux. I am now holding my breath
and hoping...

Philip

--
Philip Hazel, University of Cambridge Computing Service.