Skip to content

Commit e9c5dcd

Browse files
Nicolas Pitregitster
authored andcommitted
block-sha1: guard gcc extensions with __GNUC__
With this, the code should now be portable to any C compiler. Signed-off-by: Nicolas Pitre <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 51ea551 commit e9c5dcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block-sha1/sha1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "sha1.h"
1111

12-
#if defined(__i386__) || defined(__x86_64__)
12+
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
1313

1414
/*
1515
* Force usage of rol or ror by selecting the one with the smaller constant.
@@ -54,7 +54,7 @@
5454

5555
#if defined(__i386__) || defined(__x86_64__)
5656
#define setW(x, val) (*(volatile unsigned int *)&W(x) = (val))
57-
#elif defined(__arm__)
57+
#elif defined(__GNUC__) && defined(__arm__)
5858
#define setW(x, val) do { W(x) = (val); __asm__("":::"memory"); } while (0)
5959
#else
6060
#define setW(x, val) (W(x) = (val))

0 commit comments

Comments
 (0)