unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 4d6185512f23bc4a66b5f8f67e59b18a564822b0 1416 bytes (raw)
name: packages/patches/plink-endian-detection.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
This patch is borrowed from Debian's patches for plink

Author: Peter Green <plugwash@p10link.net>
Puropose: Fallback to endian.h if all else fails on 64bit machines
Closes: #528659
Forwarded: Shaun Purcell <plink@chgr.mgh.harvard.edu>
License: same as plink itself.
===================================================================
--- plink-1.06.orig/Rsrv.h	2009-05-15 03:35:29.000000000 +0100
+++ plink-1.06/Rsrv.h	2009-05-15 03:35:41.000000000 +0100
@@ -313,7 +313,18 @@
 #define __BIG_ENDIAN__ 1
 #define SWAPEND 1
 #elif ! defined Win32 /* Windows is little-endian is most cases, anywhere else we're stuck */
-#error "Cannot determine endianness. Make sure config.h is included or __{BIG|LITTLE}_ENDIAN__ is defined ."
+  //try endian.h before we finally bail out
+  #include <endian.h>
+  #if __BYTE_ORDER == __LITTLE_ENDIAN
+    #warning using little endian based on information from endian.h
+    #define __LITTLE_ENDIAN__ 1
+  #elif __BYTE_ORDER == __BIG_ENDIAN
+    #warning using big endian based on information from endian.h
+    #define __BIG_ENDIAN__ 1
+    #define SWAPEND 1
+  #else    
+    #error "Cannot determine endianness. Make sure config.h is included or __{BIG|LITTLE}_ENDIAN__ is defined ."
+  #endif    
 #endif
 
 /* 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 */

debug log:

solving 4d6185512f23bc4a66b5f8f67e59b18a564822b0 ...
found 4d6185512f23bc4a66b5f8f67e59b18a564822b0 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).