patch-src_osdep_byteorder_h 887 B

123456789101112131415161718192021222324252627282930313233
  1. $OpenBSD: patch-src_osdep_byteorder_h,v 1.3 2015/05/01 17:40:58 ajacoutot Exp $
  2. --- src/osdep/byteorder.h.orig Wed Aug 24 21:36:30 2011
  3. +++ src/osdep/byteorder.h Wed Aug 24 21:55:32 2011
  4. @@ -167,7 +167,7 @@
  5. * Solaris
  6. * -------
  7. */
  8. - #if defined(__sparc__)
  9. + #if defined(__sun) && defined(__SVR4)
  10. #include <sys/byteorder.h>
  11. #include <sys/types.h>
  12. #include <unistd.h>
  13. @@ -210,6 +210,19 @@
  14. // FreeBSD
  15. #ifdef __FreeBSD__
  16. #include <machine/endian.h>
  17. + #endif
  18. +
  19. + #ifdef __OpenBSD__
  20. + #include <endian.h>
  21. +
  22. + #define __cpu_to_be64(x) htobe64(x)
  23. + #define __cpu_to_be32(x) htobe32(x)
  24. + #define __be64_to_cpu(x) betoh64(x)
  25. + #define __be32_to_cpu(x) betoh32(x)
  26. + #define __le32_to_cpu(x) letoh32(x)
  27. + #define __le16_to_cpu(x) letoh16(x)
  28. +
  29. + #define AIRCRACK_NG_BYTE_ORDER_DEFINED
  30. #endif
  31. // XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...?