From a077c3dc5257347e7a50b1761943876da4604318 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 7 May 2004 23:26:43 +0000 Subject: [PATCH] * configure.in: Check for machine/endian.h too. * include/db-int.h: Include machine/endian.h if available. Check for __LITTLE_ENDIAN__ and __BIG_ENDIAN__, _MIPSEB and _MIPSEL. ticket: 2551 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16322 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/db2/ChangeLog | 4 ++++ src/util/db2/configure.in | 6 ++++-- src/util/db2/include/ChangeLog | 5 +++++ src/util/db2/include/db-int.h | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/util/db2/ChangeLog b/src/util/db2/ChangeLog index 0591d6cd6..55c393fc1 100644 --- a/src/util/db2/ChangeLog +++ b/src/util/db2/ChangeLog @@ -1,3 +1,7 @@ +2004-05-07 Ken Raeburn + + * configure.in: Check for machine/endian.h too. + 2004-05-05 Ken Raeburn * Makefile.in (all-prerecurse): Make sure headers generated by diff --git a/src/util/db2/configure.in b/src/util/db2/configure.in index b64a126d2..dc1fb1a14 100644 --- a/src/util/db2/configure.in +++ b/src/util/db2/configure.in @@ -63,8 +63,10 @@ AC_COMPILE_TYPE(u_int32_t, unsigned int) dnl checks for structures dnl checks for compiler characteristics -dnl AC_C_BIGENDIAN -AC_CHECK_HEADERS(endian.h) +dnl AC_C_BIGENDIAN - No, check at compile time; Darwin can build for multiple +dnl targets in one tree. +AC_CHECK_HEADERS(endian.h machine/endian.h) +dnl There's also sys/endian.h on IRIX, but we already check _MIPSE{L,B}. AC_C_CONST AC_CHECK_SIZEOF(int) diff --git a/src/util/db2/include/ChangeLog b/src/util/db2/include/ChangeLog index 3ca9befe5..1ad22005c 100644 --- a/src/util/db2/include/ChangeLog +++ b/src/util/db2/include/ChangeLog @@ -1,3 +1,8 @@ +2004-05-07 Ken Raeburn + + * db-int.h: Include machine/endian.h if available. Check for + __LITTLE_ENDIAN__ and __BIG_ENDIAN__, _MIPSEB and _MIPSEL. + 2004-05-05 Ken Raeburn * db-int.h: Include stdlib.h, and endian.h if available. diff --git a/src/util/db2/include/db-int.h b/src/util/db2/include/db-int.h index ddc2d4764..f50f6d048 100644 --- a/src/util/db2/include/db-int.h +++ b/src/util/db2/include/db-int.h @@ -48,12 +48,23 @@ #ifdef HAVE_ENDIAN_H # include #endif +#ifdef HAVE_MACHINE_ENDIAN_H +# include +#endif /* Handle both BIG and LITTLE defined and BYTE_ORDER matches one, or just one defined; both with and without leading underscores. Ignore "PDP endian" machines, this code doesn't support them anyways. */ #if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) && !defined(BYTE_ORDER) +# ifdef __LITTLE_ENDIAN__ +# define LITTLE_ENDIAN __LITTLE_ENDIAN__ +# endif +# ifdef __BIG_ENDIAN__ +# define BIG_ENDIAN __BIG_ENDIAN__ +# endif +#endif +#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) && !defined(BYTE_ORDER) # ifdef _LITTLE_ENDIAN # define LITTLE_ENDIAN _LITTLE_ENDIAN # endif @@ -75,6 +86,14 @@ # define BYTE_ORDER __BYTE_ORDER # endif #endif + +#if defined(_MIPSEL) && !defined(LITTLE_ENDIAN) +# define LITTLE_ENDIAN +#endif +#if defined(_MIPSEB) && !defined(BIG_ENDIAN) +# define BIG_ENDIAN +#endif + #if defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN) && defined(BYTE_ORDER) # if LITTLE_ENDIAN == BYTE_ORDER # define DB_BYTE_ORDER DB_LITTLE_ENDIAN -- 2.26.2