Re: [pcre-dev] HAVE_CONFIG_H

Pàgina inicial
Delete this message
Autor: Daniel Richard G.
Data:  
A: Robert Wishlaw
CC: PCRE
Assumpte: Re: [pcre-dev] HAVE_CONFIG_H
On Fri, 2007 Aug 31 13:22:34 -0700, Robert Wishlaw wrote:
>
> In my opinion, ALL Windows operating system specific defines, macros etc
> should be moved to the config.h.generic file.


Remember that these (notably the export declspecs) are needed whenever a
program is compiled against PCRE, not just when building PCRE. They have
to live in the actual PCRE headers---which is how most libraries do it
anyway.

> Although the current Windows declspec defines do work, they can be
> simplified and located in one place. This will eliminate the need to have to
> figure out the order of placement of header files as in, for example, the
> ordering of pcre.h and pcre_internal.h. in pcretest.c.


The advantage of the current approach (import declspecs in public
header, export declspecs in *_internal.h, include internal header first
to get export declspecs) is that the export declspecs are never publicly
visible---which is ideal, given that they are only needed in the narrow
case of building a DLL version of the library, and we don't have to
bother with a PCRE_DEFINITION macro.

I'm certainly in favor of cooping up the Windows junk as much as
possible, but this approach is (IMO) somewhat more elegant than using
PCRE_DEFINITION.


--Daniel