| @@ -1,18 +1,23 @@ | | | @@ -1,18 +1,23 @@ |
1 | $NetBSD: patch-src_city.cc,v 1.1 2013/07/08 00:56:45 rodent Exp $ | | 1 | $NetBSD: patch-src_city.cc,v 1.2 2014/01/19 02:54:56 rodent Exp $ |
2 | | | 2 | |
3 | Add support for SunOS. | | 3 | Add support for SunOS. |
4 | | | 4 | |
5 | --- src/city.cc.orig 2013-06-17 19:45:57.000000000 +0000 | | 5 | --- src/city.cc.orig 2013-06-17 19:45:57.000000000 +0000 |
6 | +++ src/city.cc | | 6 | +++ src/city.cc |
7 | @@ -69,6 +69,11 @@ static uint32 UNALIGNED_LOAD32(const cha | | 7 | @@ -69,6 +69,16 @@ static uint32 UNALIGNED_LOAD32(const cha |
8 | #define bswap_64(x) bswap64(x) | | 8 | #define bswap_64(x) bswap64(x) |
9 | #endif | | 9 | #endif |
10 | | | 10 | |
11 | +#elif defined(__sun) | | 11 | +#elif defined(__sun) |
12 | +#include <sys/byteorder.h> | | 12 | +#include <sys/byteorder.h> |
13 | +#define bswap_32(x) htonl(x) | | 13 | +#define bswap_32(x) htonl(x) |
14 | +#define bswap_64(x) htonll(x) | | 14 | +#define bswap_64(x) htonll(x) |
15 | + | | 15 | + |
| | | 16 | +#elif defined(__FreeBSD__) |
| | | 17 | +#include <sys/endian.h> |
| | | 18 | +#define bswap_32(x) bswap32(x) |
| | | 19 | +#define bswap_64(x) bswap64(x) |
| | | 20 | + |
16 | #else | | 21 | #else |
17 | | | 22 | |
18 | #include <byteswap.h> | | 23 | #include <byteswap.h> |