diff -ur libgcrypt-1.6.2/acinclude.m4 libgcrypt-1.6.2.new/acinclude.m4 --- libgcrypt-1.6.2/acinclude.m4 2014-08-18 08:46:51.000000000 +0200 +++ libgcrypt-1.6.2.new/acinclude.m4 2014-11-07 21:48:36.315702591 +0100 @@ -102,7 +102,9 @@ [tmp_do_check="no" case "${host}" in *-mingw32*) - ac_cv_sys_symbol_underscore=yes + if test "x$ac_cv_sys_symbol_underscore" = x ; then + ac_cv_sys_symbol_underscore=yes + fi ;; i386-emx-os2 | i[3456]86-pc-os2*emx | i386-pc-msdosdjgpp) ac_cv_sys_symbol_underscore=yes diff -ur libgcrypt-1.6.2/mpi/generic/mpi-asm-defs.h libgcrypt-1.6.2.new/mpi/generic/mpi-asm-defs.h --- libgcrypt-1.6.2/mpi/generic/mpi-asm-defs.h 2014-08-18 08:46:51.000000000 +0200 +++ libgcrypt-1.6.2.new/mpi/generic/mpi-asm-defs.h 2014-11-07 21:47:30.932355415 +0100 @@ -4,5 +4,9 @@ #if __GNUC__ >= 3 && defined(__x86_64__) && defined(__ILP32__) #define BYTES_PER_MPI_LIMB 8 #else +#ifdef _WIN64 +#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG_LONG) +#else #define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG) #endif +#endif diff -ur libgcrypt-1.6.2/mpi/mpi-internal.h libgcrypt-1.6.2.new/mpi/mpi-internal.h --- libgcrypt-1.6.2/mpi/mpi-internal.h 2014-08-18 08:46:51.000000000 +0200 +++ libgcrypt-1.6.2.new/mpi/mpi-internal.h 2014-11-07 21:46:02.009004456 +0100 @@ -169,6 +169,12 @@ } while (0) +#ifdef _WIN64 +#define ATTR_ABI __attribute__ ((sysv_abi)) +#else +#define ATTR_ABI +#endif + /*-- mpiutil.c --*/ #define mpi_alloc_limb_space(n,f) _gcry_mpi_alloc_limb_space((n),(f)) mpi_ptr_t _gcry_mpi_alloc_limb_space( unsigned nlimbs, int sec ); @@ -187,7 +193,7 @@ mpi_limb_t _gcry_mpih_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, mpi_limb_t s2_limb ); mpi_limb_t _gcry_mpih_add_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, - mpi_ptr_t s2_ptr, mpi_size_t size); + mpi_ptr_t s2_ptr, mpi_size_t size) ATTR_ABI; mpi_limb_t _gcry_mpih_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, mpi_ptr_t s2_ptr, mpi_size_t s2_size); @@ -195,7 +201,7 @@ mpi_limb_t _gcry_mpih_sub_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, mpi_limb_t s2_limb ); mpi_limb_t _gcry_mpih_sub_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, - mpi_ptr_t s2_ptr, mpi_size_t size); + mpi_ptr_t s2_ptr, mpi_size_t size) ATTR_ABI; mpi_limb_t _gcry_mpih_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, mpi_ptr_t s2_ptr, mpi_size_t s2_size); @@ -217,9 +223,9 @@ void _gcry_mpih_release_karatsuba_ctx( struct karatsuba_ctx *ctx ); mpi_limb_t _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, - mpi_size_t s1_size, mpi_limb_t s2_limb); + mpi_size_t s1_size, mpi_limb_t s2_limb) ATTR_ABI; mpi_limb_t _gcry_mpih_submul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, - mpi_size_t s1_size, mpi_limb_t s2_limb); + mpi_size_t s1_size, mpi_limb_t s2_limb) ATTR_ABI; void _gcry_mpih_mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size); mpi_limb_t _gcry_mpih_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize, @@ -236,7 +242,7 @@ /*-- mpih-mul_1.c (or xxx/cpu/ *.S) --*/ mpi_limb_t _gcry_mpih_mul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, - mpi_size_t s1_size, mpi_limb_t s2_limb); + mpi_size_t s1_size, mpi_limb_t s2_limb) ATTR_ABI; /*-- mpih-div.c --*/ mpi_limb_t _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size, @@ -250,9 +256,9 @@ /*-- mpih-shift.c --*/ mpi_limb_t _gcry_mpih_lshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize, - unsigned cnt); + unsigned cnt) ATTR_ABI; mpi_limb_t _gcry_mpih_rshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize, - unsigned cnt); + unsigned cnt) ATTR_ABI; /* Define stuff for longlong.h. */