[postgis-devel] Determining Endianess
pramsey at refractions.net
Mon Feb 9 10:57:31 PST 2004
Better to just find out where postgresql computes it and take it from
there. We should not be testing for endianness at runtime.
> I've included your code in pgsql2shp.
> It would be needed for postgis_inout.c
> and postgis_gist*.c where its computation
> time will be more noticeable.
> I've asked to the pgsql-hackers about using their computed
> BYTE_ORDER. Yet, I'd see better having Dave's code as an m4 macro
> and postgis switch to autoconf.
> dblasby wrote:
>>Here's a piece of code that directly tests the endian of the machine.
>>Basically, it looks at how the number 1 is stored. In the 4 byte int,
>>if its NDR, it will be in the 1st byte. If its XDR, it'll be in the
>> int test = 1;
>> if ( (((char *)(&test))) == 1)
>>postgis-devel mailing list
>>postgis-devel at postgis.refractions.net
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
| Paul Ramsey
| Refractions Research
| Email: pramsey at refractions.net
| Phone: (250) 885-0632
More information about the postgis-devel