ut_endian.h


Subject: ut_endian.h
From: Kevin Vajk (kvajk@ricochet.net)
Date: Fri Feb 23 2001 - 16:02:09 CST


I've patched ut_endian.h. I added two things; the first is for HP-UX,
and the second to produce an error if something went wrong and the
endianness was not determined, so that it'll be easy to determine
what needs changing when porting to a new architecture.

Thanks!

-- 
- Kevin Vajk
  <kvajk@ricochet.net>

Index: src/af/util/xp/ut_endian.h =================================================================== RCS file: /cvsroot/abi/src/af/util/xp/ut_endian.h,v retrieving revision 1.3 diff -u -u -r1.3 ut_endian.h --- src/af/util/xp/ut_endian.h 2001/02/17 10:36:56 1.3 +++ src/af/util/xp/ut_endian.h 2001/02/23 21:56:25 @@ -6,7 +6,14 @@ #define UT_ENDIAN_H

#if defined(__hpux) - + /* #define UT_BIG_ENDIAN */ + #include <machine/param.h> + #if defined(_BIG_ENDIAN) + #define UT_BIG_ENDIAN + #endif + #if defined(_LITTLE_ENDIAN) + #define UT_LITTLE_ENDIAN + #endif #elif defined(__QNXNTO__) #include <sys/platform.h> #if defined(__LITTLENDIAN__) @@ -28,6 +35,14 @@ #else #define UT_BIG_ENDIAN #endif +#endif + + +/* Make sure we got a definition for our platform: */ +#if defined(UT_BIG_ENDIAN) +#elif defined(UT_LITTLE_ENDIAN) +#else + #error Must define UT_BIG_ENDIAN or UT_LITTLE_ENDIAN in ut_endian.h #endif



This archive was generated by hypermail 2b25 : Fri Feb 23 2001 - 16:23:55 CST