summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2009-08-18 19:37:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-08-18 21:18:36 (GMT)
commite9c5dcd1313dd4e2f606419ce3d228c99fae2c40 (patch)
treeea4182491139b78e602ada9a1ad1345f5f4dbcea
parent51ea55190b6e72c77c96754c1bf2f149a4714848 (diff)
downloadgit-e9c5dcd1313dd4e2f606419ce3d228c99fae2c40.zip
git-e9c5dcd1313dd4e2f606419ce3d228c99fae2c40.tar.gz
git-e9c5dcd1313dd4e2f606419ce3d228c99fae2c40.tar.bz2
block-sha1: guard gcc extensions with __GNUC__
With this, the code should now be portable to any C compiler. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--block-sha1/sha1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c
index d31f2e3..92d9121 100644
--- a/block-sha1/sha1.c
+++ b/block-sha1/sha1.c
@@ -9,7 +9,7 @@
#include "sha1.h"
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
/*
* Force usage of rol or ror by selecting the one with the smaller constant.
@@ -54,7 +54,7 @@
#if defined(__i386__) || defined(__x86_64__)
#define setW(x, val) (*(volatile unsigned int *)&W(x) = (val))
-#elif defined(__arm__)
+#elif defined(__GNUC__) && defined(__arm__)
#define setW(x, val) do { W(x) = (val); __asm__("":::"memory"); } while (0)
#else
#define setW(x, val) (W(x) = (val))