[Shapelib] Re: Suggested patch for shplib

Frank Warmerdam warmerdam at pobox.com
Thu Nov 25 15:02:27 EST 2004


Alexander Stohr wrote:
> i tried the ifdef aproach for some mainstream compilers
> and it looks somewhat ugly at the specific location due 
> to the multiple dependency on compilers and versions.
> (intel takes __int64, micrsoft uses somthing else, gnu
> is introducing long long)
> 
> For using it later in your codes, there is no problem at all.
> 
> My understanding is, that the most prefered method
> for getting data types platform independent is the usage
> of the statement "#include <stdint.h>" in your code.
> This does conform to a fixed type layout on any platform.
> It introduces types like uint64_t and int64_t amongst
> several others. Its not endianess save, as soon as you
> are interchanging data files between different platforms,
> but that is really the only case where it lacks in concept.

Alex,

But I gather from what I see in /usr/include/stdint.h on Linux that once
against stdint.h is a C99 thing, and not necessarily supported on older
compilers.  Given the risk of complication, and the relatively low payoff
I don't see a real reason to act.  As noted earlier folks can always
fetch the field as double and cast it, or fetch it as a string and convert
to long long themselves.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Shapelib mailing list