| @@ -1,50 +1,54 @@ | | | @@ -1,50 +1,54 @@ |
1 | $NetBSD: patch-aa,v 1.6 2012/03/07 15:08:40 hans Exp $ | | 1 | $NetBSD: patch-aa,v 1.7 2013/05/28 19:02:18 joerg Exp $ |
2 | | | 2 | |
3 | fix tests for endianness and use our own header files to get | | 3 | fix tests for endianness and use our own header files to get |
4 | int64_t and uint64_t | | 4 | int64_t and uint64_t |
5 | | | 5 | |
6 | --- src/swarm_types.h.orig Tue Apr 10 09:46:10 2001 | | 6 | --- src/swarm_types.h.orig 2001-09-23 16:12:23.000000000 +0000 |
7 | +++ src/swarm_types.h | | 7 | +++ src/swarm_types.h |
8 | @@ -26,11 +26,21 @@ | | 8 | @@ -26,11 +26,25 @@ |
9 | #ifndef __SWARM_TYPES_H__ | | 9 | #ifndef __SWARM_TYPES_H__ |
10 | #define __SWARM_TYPES_H__ | | 10 | #define __SWARM_TYPES_H__ |
11 | | | 11 | |
12 | -#ifdef sun4 | | 12 | -#ifdef sun4 |
13 | +#ifdef __sun | | 13 | +#ifdef __sun |
14 | +#include <sys/byteorder.h> | | 14 | +#include <sys/byteorder.h> |
| | | 15 | +#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) |
15 | +#ifdef _BIG_ENDIAN | | 16 | +#ifdef _BIG_ENDIAN |
16 | #define __BIG_ENDIAN__ | | 17 | #define __BIG_ENDIAN__ |
17 | -#else /* ix86 / alpha / arm32 */ | | 18 | -#else /* ix86 / alpha / arm32 */ |
18 | +#else | | 19 | +#else |
19 | +#define __LITTLE_ENDIAN__ | | 20 | +#define __LITTLE_ENDIAN__ |
20 | +#endif | | 21 | +#endif |
| | | 22 | +#endif |
21 | +#else | | 23 | +#else |
22 | +#include <sys/endian.h> | | 24 | +#include <sys/endian.h> |
| | | 25 | +#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) |
23 | +#if BYTE_ORDER == BIG_ENDIAN | | 26 | +#if BYTE_ORDER == BIG_ENDIAN |
24 | +#define __BIG_ENDIAN__ | | 27 | +#define __BIG_ENDIAN__ |
25 | +#else | | 28 | +#else |
26 | #define __LITTLE_ENDIAN__ | | 29 | #define __LITTLE_ENDIAN__ |
27 | #endif | | 30 | #endif |
28 | +#endif | | 31 | +#endif |
| | | 32 | +#endif |
29 | | | 33 | |
30 | #ifdef WIN32 | | 34 | #ifdef WIN32 |
31 | #include <windows.h> | | 35 | #include <windows.h> |
32 | @@ -60,6 +70,10 @@ typedef int int32_ | | 36 | @@ -60,6 +74,10 @@ typedef int int32_ |
33 | typedef unsigned short uint16_t; | | 37 | typedef unsigned short uint16_t; |
34 | typedef unsigned int uint32_t; | | 38 | typedef unsigned int uint32_t; |
35 | | | 39 | |
36 | +#ifdef __NetBSD__ | | 40 | +#ifdef __NetBSD__ |
37 | +#include <sys/types.h> | | 41 | +#include <sys/types.h> |
38 | +#include <sys/inttypes.h> | | 42 | +#include <sys/inttypes.h> |
39 | +#else | | 43 | +#else |
40 | #ifndef WIN32 | | 44 | #ifndef WIN32 |
41 | #ifndef __int8_t_defined | | 45 | #ifndef __int8_t_defined |
42 | typedef long long int int64_t; | | 46 | typedef long long int int64_t; |
43 | @@ -69,6 +83,7 @@ typedef unsigned long long int uint64 | | 47 | @@ -69,6 +87,7 @@ typedef unsigned long long int uint64 |
44 | typedef INT64 int64_t; | | 48 | typedef INT64 int64_t; |
45 | typedef UINT64 uint64_t; | | 49 | typedef UINT64 uint64_t; |
46 | #endif // !WIN32 | | 50 | #endif // !WIN32 |
47 | +#endif // __NetBSD__ | | 51 | +#endif // __NetBSD__ |
48 | #endif | | 52 | #endif |
49 | | | 53 | |
50 | typedef int bool_t; | | 54 | typedef int bool_t; |