[postgis-devel] Re: [postgis-users] MSVC Patch #1

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Mon Oct 29 09:53:28 PDT 2007


On Fri, 2007-09-21 at 12:47 -0600, Charlie Savage wrote:
> Hi Mark,
> 
> Did you ever get a chance to look at this patch?  Any chance of getting 
> it applied - assuming its ok?
> 
> Charlie


Hi Charlie,

Okay I've had a look at this, and applied some parts of the non-MSVC new
files to the tree. I really liked the changes to the PROJ.4 bindings, as
it gets rid of the auto-import warnings for PROJ.4 on MingW :)

Some feedback on the other parts of the patch that weren't applied:

- inttypes.h / stdint.h

I'm guessing that these are required to allow MSVC compatibility with
snprintf()? Will these be useful for other platforms or is this purely
for MSVC? Just trying to get a feel for whereabouts these should go in
the source tree.


- rint.c

I was quite surprised that MSVC required this, since MingW doesn't
require this at all. This seems to imply that rint() is already included
as part as the MSVCRT - perhaps all that is needed is an alias from
rint() to _rint() or something similar?


- config.h.vc/ config.h / unistd.h

I think I see that this is again adding extra headers for MSVC mainly to
do with snprintf(); however it struck me that it may be better to
combine these changes in a single header file and include it the main
liblwgeom.h which should prevent duplication of the #ifdef _MSVC_VER
statements and help maintenance in the future.

Also one final thing - lex.yy.c is auto-generated, so in fact the
changes need to go into wktparse.lex file which should then be run
through flex.

Anyway, I hope this helps. I think that with a little bit more thought
(and perhaps help from Mateusz) we should be able to get something
applied for MSVC - I imagine that most of the questions are due to my
lack of understanding of the MSVC build environment.


ATB,

Mark.

-- 
ILande - Open Source Consultancy
http://www.ilande.co.uk





More information about the postgis-devel mailing list