Re: [pcre-dev] Yet Another RC

Top Page
Delete this message
Author: Sheri
Date:  
To: pcre-dev
Subject: Re: [pcre-dev] Yet Another RC
Craig Silverstein wrote:
> } Aarrgghh!! This module currently has
> }
> } #ifdef HAVE_WINDOWS_H
> } # define snprintf _snprintf
> } #endif
>
> Sheri, can you verify that the version of the code you have includes
> the above test? You say that under msys when running configure, it
> says "has windows.h...yes", so HAVE_WINDOWS_H should be true, and you
> should never be getting an error about snprintf because it should be
> replaced with _snprintf.
>
> It's a bit hard to debug without seeing the sources you have. Can you
> maybe include your config.h and your pcre_scanner_unittest.cc? It
> could be as simple as needing to #include config.h in
> pcre_scanner_unittest.cc. Is HAVE_CONFIG_H defined on your
> commandline when you run make?
>
> craig
>
>
>

When configuring with Cmake, a different config.h gets generated than
when configuring with "configure". They also vary when configuring with
Cmake for Msys/Mingw vs for Visual Studio 8.

These are the in the CMake targeting Msys vs Visual Studio:
CMake for Msys/Mingw
#define HAVE_DIRENT_H
#define HAVE_UNISTD_H
#define HAVE_BITS_TYPE_TRAITS_H
CMake for Visual Studio
/* #undef HAVE_DIRENT_H */
/* #undef HAVE_UNISTD_H */
/* #undef HAVE_BITS_TYPE_TRAITS_H */


Am attaching the complete config.h that targets Msys. My
pcre_scanner_unittest.cc is straight from the distro and it does appear
to have the mod Philip mentioned.

It is when configuring with "configure" instead of with CMake that I see
the "has windows.h...yes"

I don't think you can go by that when using Msys/Mingw to compile c++
sources. When using Msys/Mingw it uses g++ to compile c++ sources, and
it actually embeds the c++ language into the library. The pcre cpp
library is over 500K when built in Msys/Mingw.

Maybe I have windows.h because I have both Msys/Mingw and Visual Studio
Express on my system. Of course "configure" doesn't support
Windows/Visual Studio Express.

The attachment is from the Msys/CMake configuration.

If I look at the config.h in my "configure" build dir for Msys it has
much more info, including this:
/* Define to 1 if you have the <windows.h> header file. */
#define HAVE_WINDOWS_H 1

So, it gets defined where it does harm (configure) and not where its
needed (VS Studio via CMake)?

Regards,
Sheri

/* config.h for CMake builds */

#define HAVE_DIRENT_H
#define HAVE_UNISTD_H
#define HAVE_SYS_STAT_H
#define HAVE_SYS_TYPES_H
/* #undef HAVE_TYPE_TRAITS_H */
#define HAVE_BITS_TYPE_TRAITS_H

/* #undef HAVE_BCOPY */
#define HAVE_MEMMOVE
#define HAVE_STRERROR

/* #undef PCRE_STATIC */

#define SUPPORT_UTF8
#define SUPPORT_UCP
/* #undef EBCDIC */
#define BSR_ANYCRLF
#define NO_RECURSE

#define NEWLINE            -2
#define POSIX_MALLOC_THRESHOLD    10
#define LINK_SIZE        2
#define MATCH_LIMIT        10000000
#define MATCH_LIMIT_RECURSION    MATCH_LIMIT


#define MAX_NAME_SIZE    32
#define MAX_NAME_COUNT    10000


/* end config.h for CMake builds */