From 66f4ea3db7a9c1eb278b035fdae8ebea7636edb9 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 15 Sep 2009 06:17:17 +0000 Subject: [PATCH] Check __BIG_ENDIAN__ and __LITTLE_ENDIAN__ to determine endianness. In fallback code, check ia64 platforms for hpux vs everything else; HP-UX uses big-endian mode. ticket: 6565 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22761 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-platform.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index fd0bb21a0..8266b3b4e 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -466,6 +466,10 @@ typedef struct { int error; unsigned char did_run; } k5_init_t; # define K5_BE #elif defined(_LITTLE_ENDIAN) # define K5_LE +#elif defined(__BIG_ENDIAN__) || !defined(__LITTLE_ENDIAN__) +# define K5_BE +#elif defined(__LITTLE_ENDIAN__) || !defined(__BIG_ENDIAN__) +# define K5_LE #endif #if !defined(K5_BE) && !defined(K5_LE) /* Look for some architectures we know about. @@ -480,10 +484,10 @@ typedef struct { int error; unsigned char did_run; } k5_init_t; As far as I know, only PDP11 and ARM (which we don't handle here) have strange byte orders where an 8-byte value isn't laid out as either 12345678 or 87654321. */ -# if defined(__i386__) || defined(_MIPSEL) || defined(__alpha__) || defined(__ia64__) +# if defined(__i386__) || defined(_MIPSEL) || defined(__alpha__) || (defined(__ia64__) && !defined(__hpux)) # define K5_LE # endif -# if defined(__hppa__) || defined(__rs6000__) || defined(__sparc__) || defined(_MIPSEB) || defined(__m68k__) || defined(__sparc64__) || defined(__ppc__) || defined(__ppc64__) +# if defined(__hppa__) || defined(__rs6000__) || defined(__sparc__) || defined(_MIPSEB) || defined(__m68k__) || defined(__sparc64__) || defined(__ppc__) || defined(__ppc64__) || (defined(__hpux) && defined(__ia64__)) # define K5_BE # endif #endif -- 2.26.2