]> arthur.barton.de Git - netatalk.git/blobdiff - sys/netatalk/endian.h
Update NEWS
[netatalk.git] / sys / netatalk / endian.h
index 488cedcad372ba2fc7018a0f1adbee17a758fe5a..a216e60556cc090f07d55d3d94aa0489902f22fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: endian.h,v 1.5 2001-09-07 13:44:38 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.
 
 #ifdef _ISOC9X_SOURCE
 #include <inttypes.h>
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
 typedef uint8_t        u_int8_t;
 typedef uint16_t       u_int16_t;
 typedef uint32_t       u_int32_t;
 typedef uint64_t       u_int64_t;
+#endif /* ! __BIT_TYPES_DEFINED__ */
 #else
 
 /* handle sunos and solaris */
@@ -54,10 +57,13 @@ typedef int ssize_t;
  * 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
@@ -87,7 +93,7 @@ typedef unsigned long long  u_int64_t;
 #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
@@ -110,14 +116,16 @@ typedef unsigned long long  u_int64_t;
 
 #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 ) */
 
 #endif /* mips && KERNEL */
-#endif /* BYTE_ORDER */
+#endif /* BYTE_ORDER == BIGENDIAN*/
 # endif /* sun ultrix _IBMR2 */
 # endif /* ntohl */
+#endif /* BYTE_ORDER */
 
 #endif /* _ATALK_ENDIAN_H_ */
+