Re: [pcre-dev] More Windows-related/misc. tweaks

Top Page
Delete this message
Author: Daniel Richard G.
Date:  
To: Craig Silverstein
CC: pcre-dev
Subject: Re: [pcre-dev] More Windows-related/misc. tweaks
On Fri, 2007 Jul 20 12:16:47 -0700, Craig Silverstein wrote:
> } PCRECPP_EXP_DEFN should not be defined in more than one place, as
> } that is generally bad practice.
>
> Do you mean the code shouldn't be in more than place, or the compiler
> (preprocessor) shouldn't be evaluating that code in more than one
> place?


I meant the first, though the second also applies.

> In the former, we already have it in two places, right -- once in
> pcre.h (or pcre_internal.h), and once in pcrecpp.h. If the latter,
> that's why we're expanding the #if guard.


Each library (pcre vs. pcreposix vs. pcrecpp) needs its own set of export
directives, because they need to be set independently of each other. For
example, when compiling pcrecpp, PCRECPP_EXP_DEFN should be
__declspec(dllexport), but PCRE_EXP_DEFN has to be __declspec(dllimport)---
as pcrecpp needs to import symbols from pcre, but also export its own
symbols.

> } , how about breaking out the PCRECPP_EXP_DEFN definitions into a
> } separate "private" header file, to be referenced only by the pcrecpp
> } headers themselves?
>
> We could, but then we'd need to install that file -- or rather, the
> users would. In general, I like to keep the need-to-install header
> files down to as small a count as possible.


I suppose we could put the PCRECPP_EXP_DEFN definitions in pcre.h, if it's
kosher for pcre_stringpiece.h et al. to pull in that header.


--Daniel


-- 
NAME   = Daniel Richard G.       ##  Remember, skunks       _\|/_  meef?
EMAIL1 = skunk@???        ##  don't smell bad---    (/o|o\) /
EMAIL2 = skunk@???      ##  it's the people who   < (^),>
WWW    = http://www.******.org/  ##  annoy them that do!    /   \
--
(****** = site not yet online)