gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / plink-endian-detection.patch
1 This patch is borrowed from Debian's patches for plink
2
3 Author: Peter Green <plugwash@p10link.net>
4 Puropose: Fallback to endian.h if all else fails on 64bit machines
5 Closes: #528659
6 Forwarded: Shaun Purcell <plink@chgr.mgh.harvard.edu>
7 License: 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 */