windows buildkit, regex change

Andreas Albarello andreas.albarello at TERRITORIUMONLINE.COM
Sun Apr 2 11:26:14 EDT 2006


Bart,

the fix you are proposing will probably do the trick for all recent 
versions of MSVC, as well as a switch disabling strict ANSI mode in VC8 
would probably do (but I'm not sure if such a switch exists).

But, what to me seems crucial, is that anyone building Mapserver on 
Windows is still stuck to version 0.12 of gnu regex which dates to 1993. 
IMHO time has now come, at least with the advent of VC8, to try another 
POSIX compliant regex engine (e.g. PCRE), as even more recent versions 
of gnu regex are still not written in ANSI compliant C.

What do others think about this? Does anyone know about any benchmarks 
comparing different regex engines?

Best regards,
Andreas

Bart van den Eijnden (OSGIS) wrote:
> Hi Howard, list,
> 
> the regex you provide in your buildkit is not compatible with Visual 
> Studio 8, would you be able to change that? I am pretty positive this 
> would also work with Visual Studio 7.1, but cannot check that out here. 
> Maybe somebody else can check that?
> 
> In regex.c (line 4875), the following old-style function declaration 
> should be changed from:
> size_t
> regerror (errcode, preg, errbuf, errbuf_size)
>    int errcode;
>    const regex_t *preg;
>    char *errbuf;
>    size_t errbuf_size;
> 
> to:
> size_t regerror( int errcode, const regex_t* preg, char* errbuf, size_t 
> errbuf_size)
> 
> otherwise you get the following with Visual Studio 8:
> 
> c:\buildkit\mapserver-4.8.3\..\regex-0.12\regex.c(4876) : error C2081: 
> 'preg' :
> name in formal parameter list illegal
> c:\buildkit\mapserver-4.8.3\..\regex-0.12\regex.c(4876) : error C2081: 
> 'errbuf'
> : name in formal parameter list illegal
> c:\buildkit\mapserver-4.8.3\..\regex-0.12\regex.c(4876) : error C2081: 
> 'errbuf_s
> ize' : name in formal parameter list illegal
> c:\buildkit\mapserver-4.8.3\..\regex-0.12\regex.c(4877) : error C2055: 
> expected
> formal parameter list, not a type list
> c:\buildkit\mapserver-4.8.3\..\regex-0.12\regex.c(4877) : error C2082: 
> redefinit
> ion of formal parameter 'errcode'
> c:\buildkit\mapserver-4.8.3\..\regex-0.12\regex.c(4885) : warning C4996: 
> 'errcod
> e' was declared deprecated
>        C:\Program Files\Microsoft Visual Studio 
> 8\VC\INCLUDE\crtdefs.h(393) : s
> ee declaration of 'errcode'
> c:\buildkit\mapserver-4.8.3\..\regex-0.12\regex.c(4885) : error C2059: 
> syntax er
> ror : 'type'
> c:\buildkit\mapserver-4.8.3\..\regex-0.12\regex.c(4893) : error C2275: 
> 'errcode'
> : illegal use of this type as an expression
>        C:\Program Files\Microsoft Visual Studio 
> 8\VC\INCLUDE\crtdefs.h(393) : s
> ee declaration of 'errcode'
> NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 
> 8\VC\BIN\c
> l.exe"' : return code '0x2'
> Stop.
> 
> Best regards,
> Bart
> 

-- 
--------------------------------------------------------------------
Andreas Albarello
Analysis & SW Development

Territorium Online srl/GmbH
Via Buozzi/Buozzistraße 12 - I 39100 Bolzano/Bozen
email: andreas.albarello at territoriumonline.com
web:   www.territoriumonline.com
--------------------------------------------------------------------



More information about the mapserver-dev mailing list