summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 51ea551)
raw | patch | inline | side by side (parent: 51ea551)
author | Nicolas Pitre <nico@cam.org> | |
Tue, 18 Aug 2009 19:37:22 +0000 (15:37 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 18 Aug 2009 21:18:36 +0000 (14:18 -0700) |
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>
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
block-sha1/sha1.c | patch | blob | history |
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c
index d31f2e386c392e7250a08969c750b3e3c91512b1..92d9121602bfaa6e94eb51422346e3b3fdd1a225 100644 (file)
--- a/block-sha1/sha1.c
+++ b/block-sha1/sha1.c
#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.
#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))