From fe9a5107beb60395273265b5770c2f189bf237c1 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 29 May 2011 13:51:14 +0000 Subject: [PATCH] Various mingw64 fixes. --- crypto/engine/eng_aesni.c | 2 +- crypto/rc4/asm/rc4-x86_64.pl | 2 +- crypto/srp/srp_lib.c | 18 +++++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/crypto/engine/eng_aesni.c b/crypto/engine/eng_aesni.c index e9f277390a..327a49c53e 100644 --- a/crypto/engine/eng_aesni.c +++ b/crypto/engine/eng_aesni.c @@ -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", diff --git a/crypto/rc4/asm/rc4-x86_64.pl b/crypto/rc4/asm/rc4-x86_64.pl index 02bfac34f2..9c2daf40aa 100755 --- a/crypto/rc4/asm/rc4-x86_64.pl +++ b/crypto/rc4/asm/rc4-x86_64.pl @@ -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 diff --git a/crypto/srp/srp_lib.c b/crypto/srp/srp_lib.c index 9f6318281d..8eacf04534 100644 --- a/crypto/srp/srp_lib.c +++ b/crypto/srp/srp_lib.c @@ -63,13 +63,17 @@ #include #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 -- 2.25.1