54 lines
1.3 KiB
Text
54 lines
1.3 KiB
Text
$NetBSD: patch-aa,v 1.7 2013/05/28 19:02:18 joerg Exp $
|
|
|
|
fix tests for endianness and use our own header files to get
|
|
int64_t and uint64_t
|
|
|
|
--- src/swarm_types.h.orig 2001-09-23 16:12:23.000000000 +0000
|
|
+++ src/swarm_types.h
|
|
@@ -26,11 +26,25 @@
|
|
#ifndef __SWARM_TYPES_H__
|
|
#define __SWARM_TYPES_H__
|
|
|
|
-#ifdef sun4
|
|
+#ifdef __sun
|
|
+#include <sys/byteorder.h>
|
|
+#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
|
|
+#ifdef _BIG_ENDIAN
|
|
#define __BIG_ENDIAN__
|
|
-#else /* ix86 / alpha / arm32 */
|
|
+#else
|
|
+#define __LITTLE_ENDIAN__
|
|
+#endif
|
|
+#endif
|
|
+#else
|
|
+#include <sys/endian.h>
|
|
+#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
|
|
+#if BYTE_ORDER == BIG_ENDIAN
|
|
+#define __BIG_ENDIAN__
|
|
+#else
|
|
#define __LITTLE_ENDIAN__
|
|
#endif
|
|
+#endif
|
|
+#endif
|
|
|
|
#ifdef WIN32
|
|
#include <windows.h>
|
|
@@ -60,6 +74,10 @@ typedef int int32_
|
|
typedef unsigned short uint16_t;
|
|
typedef unsigned int uint32_t;
|
|
|
|
+#ifdef __NetBSD__
|
|
+#include <sys/types.h>
|
|
+#include <sys/inttypes.h>
|
|
+#else
|
|
#ifndef WIN32
|
|
#ifndef __int8_t_defined
|
|
typedef long long int int64_t;
|
|
@@ -69,6 +87,7 @@ typedef unsigned long long int uint64
|
|
typedef INT64 int64_t;
|
|
typedef UINT64 uint64_t;
|
|
#endif // !WIN32
|
|
+#endif // __NetBSD__
|
|
#endif
|
|
|
|
typedef int bool_t;
|