Re: [pcre-dev] Yet Another RC

Pàgina inicial
Delete this message
Autor: Sheri
Data:  
A: Craig Silverstein
CC: pcre-dev
Assumpte: Re: [pcre-dev] Yet Another RC
Craig Silverstein wrote:
> } > 1) cmake with msys
> }
> } Everything builds hunky dory in option 1
>
> Yay! Option 1 is the best. :-)
>
> } > 2) cmake with vc++
> } >
> } pcre_scanner_unittest.cc does not compile, because of problems with
> } snprintf in option 2
>
> This is the one where you attached the config.h in your last email?

No, but I told you the differences between 1 and 2's config.h. (the
actual config.h included was from #1)

> I
> don't see why HAVE_WINDOWS_H isn't defined in that config.h. I don't
> know anything about cmake, but that definitely seems to be the bug.
> HAVE_WINDOWS_H should definitely be #defined to when running cmake
> with c++.
>

Considering option 1 works and doesn't have it, and option 2 worked
before the latest change in cpp sources, I disagree :D
> Any cmake experts who can help diagnose what's going amiss here?
>


> } > 3) configure with msys
> }
> } get this "making" after configuring with option 3:
>
> Ah, the error reports are very interesting. It looks like the problem
> is with strtoll being defined in stdlib.h, not with the pcre code
> itself.
>
> I think there are two solutions. Try this one first:
>
> Take the code in pcrecpp.cc that currently says:
>
> } #ifdef HAVE_WINDOWS_H
> } #define HAVE_STRTOQ 1
> } #define strtoll     _strtoui64
> } #define strtoull    _strtoi64
> } #endif

>
> and change it to
>
> #ifdef HAVE_WINDOWS_H
> #define HAVE_STRTOQ 1
> #endif
>
> (Technically, configure should figure this out so it shouldn't be
> necessary at all, but we won't worry about that for right now.)
>

This doesn't seem to have done any good in Msys configure (didn't try CMake)

/bin/sh ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
-I../pcre-7.4-RC3     -O2 -MT pcrecpp.lo -MD -MP -MF .deps/pcrecpp.Tpo 
-c -o pcrecpp.lo ../pcre-7.4-RC3/pcrecpp.cc
 g++ -DHAVE_CONFIG_H -I. -I../pcre-7.4-RC3 -O2 -MT pcrecpp.lo -MD -MP 
-MF .deps/pcrecpp.Tpo -c ../pcre-7.4-RC3/pcrecpp.cc  -DDLL_EXPORT -DPIC 
-o .libs/pcrecpp.o
../pcre-7.4-RC3/pcrecpp.cc: In static member function `static bool 
pcrecpp::Arg::parse_longlong_radix(const char*, int, void*, int)':
../pcre-7.4-RC3/pcrecpp.cc:769: error: `strtoq' undeclared (first use 
this function)
../pcre-7.4-RC3/pcrecpp.cc:769: error: (Each undeclared identifier is 
reported only once for each function it appears in.)
../pcre-7.4-RC3/pcrecpp.cc: In static member function `static bool 
pcrecpp::Arg::parse_ulonglong_radix(const char*, int, void*, int)':
../pcre-7.4-RC3/pcrecpp.cc:796: error: `strtouq' undeclared (first use 
this function)
make[1]: *** [pcrecpp.lo] Error 1
make[1]: Leaving directory `/c/pcre-7.4Edit/buildRC3Msys'
make: *** [all] Error 2


> See if the code works after that (in all three configs). This takes
> advantage of the fact that pcrecpp.cc will always use strtoq instead
> of strtoll if it can, and it looks like wihndows defines strtoq so
> we're ok using it. No need to redefine strtoll at all.
>
> The second solution is to keep this code as it is:
>
> } #ifdef HAVE_WINDOWS_H
> } #define HAVE_STRTOQ 1
> } #define strtoll     _strtoui64
> } #define strtoull    _strtoi64
> } #endif

>
> but move it to after all the #includes. (Put it right before the
> "namespace pcrecpp".) That should also fix things.
>
> Let me know how these work!
>


Result in Msys/Configure looks eerily similar (in fact identical except
for a line number)

/bin/sh ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
-I../pcre-7.4-RC3     -O2 -MT pcrecpp.lo -MD -MP -MF .deps/pcrecpp.Tpo 
-c -o pcrecpp.lo ../pcre-7.4-RC3/pcrecpp.cc
 g++ -DHAVE_CONFIG_H -I. -I../pcre-7.4-RC3 -O2 -MT pcrecpp.lo -MD -MP 
-MF .deps/pcrecpp.Tpo -c ../pcre-7.4-RC3/pcrecpp.cc  -DDLL_EXPORT -DPIC 
-o .libs/pcrecpp.o
../pcre-7.4-RC3/pcrecpp.cc: In static member function `static bool 
pcrecpp::Arg::parse_longlong_radix(const char*, int, void*, int)':
../pcre-7.4-RC3/pcrecpp.cc:770: error: `strtoq' undeclared (first use 
this function)
../pcre-7.4-RC3/pcrecpp.cc:770: error: (Each undeclared identifier is 
reported only once for each function it appears in.)
../pcre-7.4-RC3/pcrecpp.cc: In static member function `static bool 
pcrecpp::Arg::parse_ulonglong_radix(const char*, int, void*, int)':
../pcre-7.4-RC3/pcrecpp.cc:797: error: `strtouq' undeclared (first use 
this function)
make[1]: *** [pcrecpp.lo] Error 1
make[1]: Leaving directory `/c/pcre-7.4Edit/build2RC3Msys'
make: *** [all] Error 2



Since neither of the suggestions made a difference in Msys/configure, I
didn't see a point in trying CMake, but let me know if you think it
would help.


Regards,
Sheri