pkgsrc/emulators/swarm/patches/patch-aa
2005-11-03 21:51:57 +00:00

39 lines
918 B
Text

$NetBSD: patch-aa,v 1.5 2005/11/03 21:51:57 rillig Exp $
fix tests for endianness and use our own header files to get
int64_t and uint64_t
--- src/swarm_types.h.orig Tue Apr 10 09:46:10 2001
+++ src/swarm_types.h
@@ -26,9 +26,10 @@
#ifndef __SWARM_TYPES_H__
#define __SWARM_TYPES_H__
-#ifdef sun4
+#include <sys/endian.h>
+#if BYTE_ORDER == BIG_ENDIAN
#define __BIG_ENDIAN__
-#else /* ix86 / alpha / arm32 */
+#else
#define __LITTLE_ENDIAN__
#endif
@@ -60,6 +61,10 @@
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 +74,7 @@
typedef INT64 int64_t;
typedef UINT64 uint64_t;
#endif // !WIN32
+#endif // __NetBSD__
#endif
typedef int bool_t;