/*
- * $Id: endian.h,v 1.6 2001-09-14 14:31:10 rufustfirefly Exp $
+ * $Id: endian.h,v 1.9 2009-01-06 20:05:00 morgana Exp $
*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
* various types are forever. this makes some assumptions about integer
* sizes. */
#if defined (ultrix) || defined(HAVE_32BIT_LONGS) || defined(HAVE_64BIT_LONGS)
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
typedef int int32_t;
+#endif
#endif /* ultrix || HAVE_32BIT_LONGS || HAVE_64BIT_LONGS */
#ifdef ultrix
#define PDP_ENDIAN 3412
-#ifdef WORDS_BIGENDIAN
+#if defined(WORDS_BIGENDIAN) || defined(_BIG_ENDIAN)
#define BYTE_ORDER BIG_ENDIAN
#else
#define BYTE_ORDER LITTLE_ENDIAN
#else /* mips && KERNEL */
-#if !( defined( sun ) && defined( i386 ))
+#if !( defined( sun ) && ( defined( i386 ) || defined(__x86_64) ) )
unsigned short ntohs(), htons();
unsigned int ntohl(), htonl();
#endif /* ! ( sun && i386 ) */