[geos-devel] Portability

Yury A. Bychkov ybychkov at direct.ca
Sat Aug 31 05:20:54 EDT 2002

Hi Everyone,

Paul Ramsey wrote:
> So, working through the compilation bit by bit, some problems seem to be:
> - occasionally stdio.h is not declared where it is needed (maybe VC++
> papers over this automatically)
> - the compiler cannot find declarations for __min() and __max(),
> although it *can* find declarations for min() and max(). What is the
> difference between them? In GeometryCollection.cpp line 55, __max() is
> used while an almost identical function just above it uses max().
I am rather happy that there are so few incompatibilities so far. Martin has
already explained __max/max origin in his message:

Martin Davis wrote:
>Actually, the original max/__max discrepancy arose due to incompatibilities
>VC++6 and VC++7 !  For some reason VC++6 didn't recognize the STL max, only the
> function __max.  I'm sure the incompatibilities between MSVC and GCC will be
> worse.

>We've already implemented a similar idea to Norman's, via the platform.h file
> (although compiler.h might be a better name).  I like his clever template
> for min and max.  Hopefully there won't be too many more of these, though,
> or we'll be reinventing a lot of wheels.
Yes, these templates are very nice. I'll put them in compiler.h (after I rename

> Yury, do you think the STLPort idea might be a better way of handling this?
I am not sure yet. If there are not a lot of such problems (and based on Paul's
message (and on my impression that I probably already used all needed STL
functions at least once) we can hope that it is so), it would probably be better
to avoid external libraries. Otherwise we can always switch to STLPort

More information about the geos-devel mailing list