openbsd-ports/security/aircrack-ng/patches/patch-src_osdep_byteorder_h

33 lines
891 B
Plaintext

$OpenBSD: patch-src_osdep_byteorder_h,v 1.2 2011/08/25 12:51:56 naddy Exp $
--- src/osdep/byteorder.h.orig Wed Aug 24 21:36:30 2011
+++ src/osdep/byteorder.h Wed Aug 24 21:55:32 2011
@@ -167,7 +167,7 @@
* Solaris
* -------
*/
- #if defined(__sparc__)
+ #if defined(__sun) && defined(__SVR4)
#include <sys/byteorder.h>
#include <sys/types.h>
#include <unistd.h>
@@ -210,6 +210,19 @@
// FreeBSD
#ifdef __FreeBSD__
#include <machine/endian.h>
+ #endif
+
+ #ifdef __OpenBSD__
+ #include <machine/endian.h>
+
+ #define __cpu_to_be64(x) htobe64(x)
+ #define __cpu_to_be32(x) htobe32(x)
+ #define __be64_to_cpu(x) betoh64(x)
+ #define __be32_to_cpu(x) betoh32(x)
+ #define __le32_to_cpu(x) letoh32(x)
+ #define __le16_to_cpu(x) letoh16(x)
+
+ #define AIRCRACK_NG_BYTE_ORDER_DEFINED
#endif
// XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...?