Re: [pcre-dev] 7.4-RC1 test release (doesn't build)

Inizio della pagina
Delete this message
Autore: Bob Rossi
Data:  
To: pcre-dev
Oggetto: Re: [pcre-dev] 7.4-RC1 test release (doesn't build)
On Fri, Sep 14, 2007 at 12:08:24PM +0100, Philip Hazel wrote:
> On Thu, 13 Sep 2007, Sheri wrote:
> > However, in another dir (where I didn't disable cpp) when it tried to
> > compile pcrecpp.cc there were errors. Because of the errors and I
> > guess the order of building, make failed to create pcretest.exe,
> > pcredemo.exe and pcregrep.exe (in addition to the cpp components).
>
> > error: `::strtoll' has not been declared
>
> Ha!
>
> As a consequence of feedback on 7.3 from Windows users, the following
> lines were added to pcrecpp.cc:
>
> #ifdef _WIN32
> #define HAVE_STRTOQ 1
> #define strtoll     _strtoui64
> #define strtoull    _strtoi64
> #endif

>
> and the following lines were added to pcrecpp_unittest.cc and
> pcre_scanner_unittest.cc:
>
> #ifdef _WIN32
> #define snprintf _snprintf
> #endif
>
> I strongly suspect this is what is causing you trouble. Please try
> removing those lines.
>
> As a non-Windows user, I won't know what to do if that succeeds because
> without those lines, it was broken for other Windows users. If that test
> fails, I still don't know what to do! Help!


Hi,

There are 2 solutions we can take. We can use the __GCC__ symbol to say,
"don't do this if it's gcc" or we can use _MSC_VER to say, "only do this
if we are visual studio cl".

I'm not positive, but I think it might be good to do

#if defined (_WIN32) && defined (_MSC_VER)

which will allow that code to execute on windows with the windows
compiler.

It would be really helpful if we knew how other windows compiler handled
this code. For instance, if borland required this code as well, then
perhaps we could use the __GCC__ to exclude the code from being defined.

Bob Rossi