Various mingw64 fixes.
authorAndy Polyakov <appro@openssl.org>
Sun, 29 May 2011 13:51:14 +0000 (13:51 +0000)
committerAndy Polyakov <appro@openssl.org>
Sun, 29 May 2011 13:51:14 +0000 (13:51 +0000)
crypto/engine/eng_aesni.c
crypto/rc4/asm/rc4-x86_64.pl
crypto/srp/srp_lib.c

index e9f277390aee0f0e66fe5394ed0ca9b599aadd13..327a49c53eb5b39b438df9d4a9ab7c12be880900 100644 (file)
@@ -176,7 +176,7 @@ static int aesni_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
 
 #define AESNI_MIN_ALIGN        16
 #define AESNI_ALIGN(x) \
-       ((void *)(((unsigned long)(x)+AESNI_MIN_ALIGN-1)&~(AESNI_MIN_ALIGN-1)))
+       ((void *)(((size_t)(x)+AESNI_MIN_ALIGN-1)&~(AESNI_MIN_ALIGN-1)))
 
 /* Engine names */
 static const char   aesni_id[] = "aesni",
index 02bfac34f29fa9cec1902f8ac709ff4056e6e6a2..9c2daf40aad88a983a2eddef6dadfc1e8c9cebac 100755 (executable)
@@ -119,6 +119,7 @@ $out="%rcx";            # arg4
 {
 $code=<<___;
 .text
+.extern        OPENSSL_ia32cap_P
 
 .globl RC4
 .type  RC4,\@function,4
@@ -425,7 +426,6 @@ $idx="%r8";
 $ido="%r9";
 
 $code.=<<___;
-.extern        OPENSSL_ia32cap_P
 .globl RC4_set_key
 .type  RC4_set_key,\@function,3
 .align 16
index 9f6318281db737b4e6b964dddc2d5d6822d47fc4..8eacf045344803e476034f71e92480e5033dd1c7 100644 (file)
 #include <openssl/evp.h>
 
 #if (BN_BYTES == 8)
-#define bn_pack4(a1,a2,a3,a4) 0x##a1##a2##a3##a4##ul
-#endif
-#if (BN_BYTES == 4)
-#define bn_pack4(a1,a2,a3,a4)  0x##a3##a4##ul, 0x##a1##a2##ul
-#endif
-#if (BN_BYTES == 2)
-#define bn_pack4(a1,a2,a3,a4) 0x##a4##u,0x##a3##u,0x##a2##u,0x##a1##u
+# if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
+#  define bn_pack4(a1,a2,a3,a4) 0x##a1##a2##a3##a4##UI64
+# elif defined(__arch64__)
+#  define bn_pack4(a1,a2,a3,a4) 0x##a1##a2##a3##a4##UL
+# else
+#  define bn_pack4(a1,a2,a3,a4) 0x##a1##a2##a3##a4##ULL
+# endif
+#elif (BN_BYTES == 4)
+# define bn_pack4(a1,a2,a3,a4)  0x##a3##a4##UL, 0x##a1##a2##UL
+#else
+# error "unsupported BN_BYTES"
 #endif