From: Sandro Santilli Date: Fri, 17 Dec 2004 10:10:01 +0000 (+0000) Subject: getMachineEndian exported X-Git-Tag: pgis_1_0_0RC1~146 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4af622afaffb0c0a8bd4b2a7a061a34f3bedd8e5;p=postgis getMachineEndian exported git-svn-id: http://svn.osgeo.org/postgis/trunk@1158 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/lwgparse.c b/lwgeom/lwgparse.c index 8965e1d9e..1768a86ff 100644 --- a/lwgeom/lwgparse.c +++ b/lwgeom/lwgparse.c @@ -21,12 +21,12 @@ void set_zm(char z, char m); void close_parser(void); -static int endian_check_int = 1; // dont modify this!!! - #undef LITTLE_ENDIAN #define LITTLE_ENDIAN 1 -static char getMachineEndian() +char getMachineEndian() { + static int endian_check_int = 1; // dont modify this!!! + return *((char *) &endian_check_int); // 0 = big endian, 1 = little endian } diff --git a/lwgeom/wktparse.h b/lwgeom/wktparse.h index f975845d8..2b13051fa 100644 --- a/lwgeom/wktparse.h +++ b/lwgeom/wktparse.h @@ -71,3 +71,4 @@ char* unparse_WKT(byte* serialized, allocator alloc,freeor free); char* unparse_WKB(byte* serialized, allocator alloc,freeor free, unsigned int endian); +char getMachineEndian();