ogdi-3.2.0-endianess.patch 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From 0cc56791fa5f43a399adcea438d7254611573f2d Mon Sep 17 00:00:00 2001
  2. From: Dennis Schridde <devurandom@gmx.net>
  3. Date: Tue, 28 Nov 2017 21:53:51 +0100
  4. Subject: [PATCH 1/6] Use endian.h to determine endianness
  5. glibc and others have an endian.h header that contains a __BYTE_ORDER macro,
  6. which can be used to determine endianness. The header might also be called
  7. sys/endian.h on some systems.
  8. ---
  9. vpflib/include/machine.h | 7 ++++---
  10. 1 file changed, 4 insertions(+), 3 deletions(-)
  11. diff --git a/vpflib/include/machine.h b/vpflib/include/machine.h
  12. index 808522d..cee8774 100644
  13. --- a/vpflib/include/machine.h
  14. +++ b/vpflib/include/machine.h
  15. @@ -15,10 +15,11 @@ typedef struct
  16. long output;
  17. } xBYTE_ORDER;
  18. -#if SYS_BIG_ENDIAN == 1
  19. -#define MACHINE_BYTE_ORDER MOST_SIGNIFICANT
  20. -#else
  21. +#include <endian.h>
  22. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  23. #define MACHINE_BYTE_ORDER LEAST_SIGNIFICANT
  24. +#elif __BYTE_ORDER == __BIG_ENDIAN
  25. +#define MACHINE_BYTE_ORDER MOST_SIGNIFICANT
  26. #endif
  27. #ifdef _WINDOWS
  28. --
  29. 2.15.0