SF.net SVN: gar:[23731] csw/mgar/pkg/git/trunk
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Thu May 29 23:16:00 CEST 2014
Revision: 23731
http://sourceforge.net/p/gar/code/23731
Author: bdwalton
Date: 2014-05-29 21:15:59 +0000 (Thu, 29 May 2014)
Log Message:
-----------
git/trunk: cherry pick a branch from upstream's next to obtain some endianess fixes
Modified Paths:
--------------
csw/mgar/pkg/git/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/git/trunk/files/0007-endianess-fix.patch
Modified: csw/mgar/pkg/git/trunk/Makefile
===================================================================
--- csw/mgar/pkg/git/trunk/Makefile 2014-05-29 20:21:08 UTC (rev 23730)
+++ csw/mgar/pkg/git/trunk/Makefile 2014-05-29 21:15:59 UTC (rev 23731)
@@ -101,6 +101,7 @@
# this patch is required on current9s (not necessarily all sparc boxes) due
# to the selection of available utf8 locales.
PATCHFILES_isa-sparcv8 += 0005-Force-en_US.UTF-8-for-a-git-svn-test.patch
+PATCHFILES += 0007-endianess-fix.patch
fdirs = $(bindir_install) $(mandir) $(libexecdir_install)
define _git_files
Added: csw/mgar/pkg/git/trunk/files/0007-endianess-fix.patch
===================================================================
--- csw/mgar/pkg/git/trunk/files/0007-endianess-fix.patch (rev 0)
+++ csw/mgar/pkg/git/trunk/files/0007-endianess-fix.patch 2014-05-29 21:15:59 UTC (rev 23731)
@@ -0,0 +1,63 @@
+From 6986b4ab224dce1e4f9d6f0c7c84ad908fef72e8 Mon Sep 17 00:00:00 2001
+From: Junio C Hamano <gitster at pobox.com>
+Date: Wed, 7 May 2014 15:52:14 -0700
+Subject: [PATCH] Merge branch 'cb/byte-order' into next
+
+* cb/byte-order:
+ compat/bswap.h: restore preference __BIG_ENDIAN over BIG_ENDIAN
+ compat/bswap.h: detect endianness on more platforms that don't use BYTE_ORDER
+---
+ compat/bswap.h | 33 ++++++++++++++++++++++++---------
+ 1 file changed, 24 insertions(+), 9 deletions(-)
+
+diff --git a/compat/bswap.h b/compat/bswap.h
+index 120c6c1..c4293db 100644
+--- a/compat/bswap.h
++++ b/compat/bswap.h
+@@ -101,19 +101,34 @@ static inline uint64_t git_bswap64(uint64_t x)
+ #undef ntohll
+ #undef htonll
+
+-#if !defined(__BYTE_ORDER)
+-# if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)
+-# define __BYTE_ORDER BYTE_ORDER
+-# define __LITTLE_ENDIAN LITTLE_ENDIAN
+-# define __BIG_ENDIAN BIG_ENDIAN
++#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
++
++# define GIT_BYTE_ORDER __BYTE_ORDER
++# define GIT_LITTLE_ENDIAN __LITTLE_ENDIAN
++# define GIT_BIG_ENDIAN __BIG_ENDIAN
++
++#elif defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)
++
++# define GIT_BYTE_ORDER BYTE_ORDER
++# define GIT_LITTLE_ENDIAN LITTLE_ENDIAN
++# define GIT_BIG_ENDIAN BIG_ENDIAN
++
++#else
++
++# define GIT_BIG_ENDIAN 4321
++# define GIT_LITTLE_ENDIAN 1234
++
++# if defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
++# define GIT_BYTE_ORDER GIT_BIG_ENDIAN
++# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
++# define GIT_BYTE_ORDER GIT_LITTLE_ENDIAN
++# else
++# error "Cannot determine endianness"
+ # endif
+-#endif
+
+-#if !defined(__BYTE_ORDER)
+-# error "Cannot determine endianness"
+ #endif
+
+-#if __BYTE_ORDER == __BIG_ENDIAN
++#if GIT_BYTE_ORDER == GIT_BIG_ENDIAN
+ # define ntohll(n) (n)
+ # define htonll(n) (n)
+ #else
+--
+1.8.3.2
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list