compilation fixes
authorClaus Gittinger <cg@exept.de>
Sat, 23 Mar 2019 20:28:53 +0100
changeset 23958 1c903aa4a100
parent 23957 0094f9be672e
child 23959 5e284faa1acc
compilation fixes
SHA1Stream.st
--- a/SHA1Stream.st	Sat Mar 23 20:24:47 2019 +0100
+++ b/SHA1Stream.st	Sat Mar 23 20:28:53 2019 +0100
@@ -49,15 +49,19 @@
     unsigned char buffer[64];
 } SHA1_CTX;
 
-#if defined(__GNUC__) || defined(__CLANG__)
+#if (defined(__GNUC__) || defined(__CLANG__))
 # define STATIC_INLINE static inline
-# define __SSE4_1__ 1
-# define __SHA__    1
-# include <immintrin.h>
+# if (defined(__SSE4_1__) && defined(__SHA__))
+#  if __SSE4_1__ && __SHA__
+// # define __SSE4_1__ 1
+// # define __SHA__    1
+#   include <immintrin.h>
  static void SHA1Transform(unsigned int32 state[5], unsigned char buffer[64]);
  // static void __attribute__ ((__target__ ("sha,sse4.1"))) SHA1Transform_x86(unsigned int32 state[5], unsigned char buffer[64]);
  static void SHA1Transform_x86(unsigned int32 state[5], unsigned char buffer[64]);
-# define USE_SHA_INTRINSICS
+#   define USE_SHA_INTRINSICS
+#  endif
+# endif
 #endif
 
 #ifndef USE_SHA_INTRINSICS
@@ -196,7 +200,7 @@
     a = b = c = d = e = 0;
 }
 
-#if defined(__CLANG__)
+#if defined(USE_SHA_INTRINSICS)
 
 //
 // a specially tuned version
@@ -396,10 +400,6 @@
     state[4] = _mm_extract_epi32(E0, 3);
 }
 
-#endif
-
-#ifdef USE_SHA_INTRINSICS
-
 static void
 #if USE_ANSI_C
 SHA1Transform(unsigned int32 state[5], unsigned char buffer[64])