Opened 13 years ago

Closed 13 years ago

#1172 closed defect (fixed)

Solaris requires endian macros in liblwgeom for lwin_wkb and lwout_wkb

Reported by: rroliver Owned by: strk
Priority: medium Milestone: PostGIS 2.0.0
Component: liblwgeom Version: master
Keywords: Solaris endian Cc: martin

Description

Also refer to #473 #365 #623

Endian macros BIG_ENDIAN, LITTLE_ENDIAN and BYTE_ORDER are not provided by solaris.

By default _BIG_ENDIAN or _LITTLE_ENDIAN will be defined depending on the given target system

Find attached a patch which a) Moves inclusion of <sys/param.h> (for mingw etc. see #473) into

liblwgeom_internal.h from lwin_wkb.c and lwout_wkb.c

b) defines LITTLE_ENDIAN and BIG_ENDIAN if still undefined c) If BYTE_ORDER undefined, defines it appropriately on solaris (though does

not catch for other OSes if BYTE_ORDER undefined...)

Not sure which other OSes do not define the above.

Also not sure if this should really go into a separate header (lw_endian.h ?) that is included by liblwgeom_internal.h

Thoughts?

Attachments (1)

postgis-2.0.0SVN-lwgeom_define_endian_macros_solaris-1.patch (2.3 KB ) - added by rroliver 13 years ago.
First cut at adding endian macros for solaris

Download all attachments as: .zip

Change History (6)

by rroliver, 13 years ago

First cut at adding endian macros for solaris

comment:1 by strk, 13 years ago

I think we should internally use: ./liblwgeom/liblwgeom_internal.h:extern char getMachineEndian(void);

comment:2 by strk, 13 years ago

Owner: changed from postgis-devel@… to strk
Status: newassigned

I'll work on it, get ready for testing.

comment:3 by strk, 13 years ago

Please try r8488 and let me know. Thank you.

comment:4 by martin, 13 years ago

Cc: martin added

BYTE_ORDER now passes properly, next missing on Solaris is the definition of INFINITY for postgis/gserialized_gist_2d.c - I think that's the last one. Shall we keep this as a general Solaris ticket ?

comment:5 by strk, 13 years ago

Resolution: fixed
Status: assignedclosed

No please, file a new one. Possibly with a patch. Thank you !

Note: See TracTickets for help on using tickets.