Ticket #1172 (closed defect: fixed)

Opened 21 months ago

Last modified 17 months ago

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: trunk
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

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

Change History

Changed 21 months ago by rroliver

First cut at adding endian macros for solaris

Changed 17 months ago by strk

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

Changed 17 months ago by strk

  • owner changed from postgis-devel@… to strk
  • status changed from new to assigned

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

Changed 17 months ago by strk

Please try r8488 and let me know. Thank you.

Changed 17 months ago by martin

  • 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 ?

Changed 17 months ago by strk

  • status changed from assigned to closed
  • resolution set to fixed

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

Note: See TracTickets for help on using tickets.