summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2017-11-24 20:25:04 -0800
committerEmil Velikov <emil.l.velikov@gmail.com>2017-12-15 19:09:31 +0000
commit9a49b36368e3c5e03610ac8c37ab2af9fa0c769d (patch)
treed838b1981267044df2ab70079033da4ace7c3779
parent4b4d8dad71f815649e8df3fcc0976f52ff2a7ae1 (diff)
util: Assume little endian in the absence of platform-specific handling
(cherry picked from commit 6a353479a7577dcff7c7a31809f27b59270648fb) Squashed with: util: Use preprocessor correctly Fixes: 6a353479a757 ("util: Assume little endian in the absence of platform-specific handling") (cherry picked from commit b8cbad624b8198949d63c0211fe4925fc3bb9a7a) Squashed with: util: Just give up and define PIPE_ARCH_LITTLE_ENDIAN on MSVC MSVC doesn't support #warning?! Getting really tired of this. (cherry picked from commit 676761252b731a6bf408e4dca694c31d74a995fc) Squashed with: util: Also include endian.h on cygwin If u_endian.h can't determine the endianess, the default behaviour in sha1.c is to build for big-endian Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit 2c62ccb10a7f3a2962f51688a3ae957254c5ce9b)
-rw-r--r--src/util/u_endian.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/u_endian.h b/src/util/u_endian.h
index b9d563dd435..9e09f801812 100644
--- a/src/util/u_endian.h
+++ b/src/util/u_endian.h
@@ -27,7 +27,7 @@
#ifndef U_ENDIAN_H
#define U_ENDIAN_H
-#if defined(__GLIBC__) || defined(ANDROID)
+#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
#include <endian.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -64,6 +64,10 @@
# define PIPE_ARCH_BIG_ENDIAN
#endif
+#elif defined(_MSC_VER)
+
+#define PIPE_ARCH_LITTLE_ENDIAN
+
#endif
#endif