[Shapelib] Re: Suggested patch for shplib

Alexander Stohr alexander.stohr at gmx.de
Thu Nov 25 14:17:48 EST 2004

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.


----- Original Message ----- 
From: "ANDY CANFIELD" <andy_canfield at hotmail.com>
To: <shapelib at maptools.org>; <paulbalomiri at gmail.com>
Sent: Tuesday, November 23, 2004 11:48 PM
Subject: RE: [Shapelib] Re: Suggested patch for shplib

> long long is not cross platform as far as I know. If you are using Win32 
> then it maps to __int64 but it would make the library non-portable between 
> systems. long long is ANSI/ISO C legal as of C99 but not all platforms 
> implement it. I would stay away from it just because I hate #ifndef stuff 
> clutering up libraries. 

More information about the Shapelib mailing list