Re: [PATCH] Add extra logic required to detect endianness on Solaris

2014-05-02 Thread Charles Bailey
On Thu, May 01, 2014 at 11:58:26AM -0700, Junio C Hamano wrote: > > This patch seems to address two unrelated issues in that. > > (1) The existing support does not help a platform where the > convention is to define either _BIG_ENDIAN (with one leading > underscore) or _LITTLE_ENDIAN a

Re: [PATCH] Add extra logic required to detect endianness on Solaris

2014-05-01 Thread Junio C Hamano
Junio C Hamano writes: > Just a thought. > > I am wondering if you may want to go the other way around. That is, > instead of using "we have byte-order, big and little and the way to > determine endianness is to see byte-order matches which of the > latter two", use "there may be either big or l

Re: [PATCH] Add extra logic required to detect endianness on Solaris

2014-05-01 Thread Junio C Hamano
Junio C Hamano writes: > Charles Bailey writes: > >> #if !defined(__BYTE_ORDER) >> +/* Known to be needed on Solaris but designed to potentially more portable >> */ >> + >> +#if !defined(__BIG_ENDIAN) >> +#define __BIG_ENDIAN 4321 >> +#endif >> + >> +#if !defined(__LITTLE_ENDIAN) >> +#define _

Re: [PATCH] Add extra logic required to detect endianness on Solaris

2014-05-01 Thread Junio C Hamano
Charles Bailey writes: > #if !defined(__BYTE_ORDER) > +/* Known to be needed on Solaris but designed to potentially more portable */ > + > +#if !defined(__BIG_ENDIAN) > +#define __BIG_ENDIAN 4321 > +#endif > + > +#if !defined(__LITTLE_ENDIAN) > +#define __LITTLE_ENDIAN 1234 > +#endif > + > +#if

[PATCH] Add extra logic required to detect endianness on Solaris

2014-05-01 Thread Charles Bailey
Signed-off-by: Charles Bailey --- The endian detection added in 7e3dae494 isn't sufficient for the Solaris Studio compilers. This adds some fallback logic which works for Solaris but would also work for AIX and Linux if it were needed. compat/bswap.h | 21 + 1 file changed,