With this, the code should now be portable to any C compiler. Signed-off-by: Nicolas Pitre <nico@xxxxxxx> --- On Tue, 18 Aug 2009, Nicolas Pitre wrote: > On Tue, 18 Aug 2009, Junio C Hamano wrote: > > > Another issue, especially with your "openssl sha1 removal" patch, is if we > > can assume gcc everywhere. As far as I can tell, block-sha1/sha1.c will > > be the first unconditional use of inline asm or statement expression on > > i386/amd64. Are folks on Solaris and other platforms Ok with this? > > I guess we can guard the first with ifdef(__GNUC__) which should help > people with MSVC. That should take care of x86 at least. Here it is. 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)) -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html