28 lines
852 B
Plaintext
28 lines
852 B
Plaintext
$OpenBSD: patch-src_libical_icaltz-util_c,v 1.3 2012/03/23 11:58:23 ajacoutot Exp $
|
|
--- src/libical/icaltz-util.c.orig Tue Dec 13 18:08:18 2011
|
|
+++ src/libical/icaltz-util.c Fri Mar 23 12:40:27 2012
|
|
@@ -32,6 +32,14 @@
|
|
#if defined(sun) && defined(__SVR4)
|
|
#include <sys/types.h>
|
|
#include <sys/byteorder.h>
|
|
+#elif defined(__OpenBSD__)
|
|
+#include <sys/types.h>
|
|
+#define __BYTE_ORDER _BYTE_ORDER
|
|
+#define __LITTLE_ENDIAN _LITTLE_ENDIAN
|
|
+#define __BIG_ENDIAN _BIG_ENDIAN
|
|
+#define bswap_16 swap16
|
|
+#define bswap_32 swap32
|
|
+#define bswap_64 swap64
|
|
#else
|
|
# ifdef HAVE_BYTESWAP_H
|
|
# include <byteswap.h>
|
|
@@ -144,6 +152,8 @@ decode (const void *ptr)
|
|
if (sizeof (int) == 4)
|
|
#ifdef _BIG_ENDIAN
|
|
return *(const int *) ptr;
|
|
+#elif __OpenBSD__
|
|
+ return swap32 (*(const uint32_t *) ptr);
|
|
#else
|
|
return BSWAP_32 (*(const int *) ptr);
|
|
#endif
|