From 4af622afaffb0c0a8bd4b2a7a061a34f3bedd8e5 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 17 Dec 2004 10:10:01 +0000 Subject: [PATCH] getMachineEndian exported git-svn-id: http://svn.osgeo.org/postgis/trunk@1158 b70326c6-7e19-0410-871a-916f4a2858ee --- lwgeom/lwgparse.c | 6 +++--- lwgeom/wktparse.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) 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(); -- 2.50.1