gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / patches / plink-endian-detection.patch
CommitLineData
0dbb7ac2
EF
1This patch is borrowed from Debian's patches for plink
2
3Author: Peter Green <plugwash@p10link.net>
4Puropose: Fallback to endian.h if all else fails on 64bit machines
5Closes: #528659
6Forwarded: Shaun Purcell <plink@chgr.mgh.harvard.edu>
7License: same as plink itself.
8===================================================================
9--- plink-1.06.orig/Rsrv.h 2009-05-15 03:35:29.000000000 +0100
10+++ plink-1.06/Rsrv.h 2009-05-15 03:35:41.000000000 +0100
11@@ -313,7 +313,18 @@
12 #define __BIG_ENDIAN__ 1
13 #define SWAPEND 1
14 #elif ! defined Win32 /* Windows is little-endian is most cases, anywhere else we're stuck */
15-#error "Cannot determine endianness. Make sure config.h is included or __{BIG|LITTLE}_ENDIAN__ is defined ."
16+ //try endian.h before we finally bail out
17+ #include <endian.h>
18+ #if __BYTE_ORDER == __LITTLE_ENDIAN
19+ #warning using little endian based on information from endian.h
20+ #define __LITTLE_ENDIAN__ 1
21+ #elif __BYTE_ORDER == __BIG_ENDIAN
22+ #warning using big endian based on information from endian.h
23+ #define __BIG_ENDIAN__ 1
24+ #define SWAPEND 1
25+ #else
26+ #error "Cannot determine endianness. Make sure config.h is included or __{BIG|LITTLE}_ENDIAN__ is defined ."
27+ #endif
28 #endif
29
30 /* FIXME: all the mess below needs more efficient implementation - the current one is so messy to work around alignment problems on some platforms like Sun and HP 9000 */