Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

block-sha1: guard gcc extensions with __GNUC__

With this, the code should now be portable to any C compiler.

Signed-off-by: Nicolas Pitre <>
Signed-off-by: Junio C Hamano <>
  • Loading branch information...
commit e9c5dcd1313dd4e2f606419ce3d228c99fae2c40 1 parent 51ea551
Nicolas Pitre authored gitster committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 block-sha1/sha1.c
4 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)
#define setW(x, val) (W(x) = (val))
Please sign in to comment.
Something went wrong with that request. Please try again.