diff options
Diffstat (limited to 'src/libgcrypt-1-mingw-w64.patch')
-rw-r--r-- | src/libgcrypt-1-mingw-w64.patch | 156 |
1 files changed, 107 insertions, 49 deletions
diff --git a/src/libgcrypt-1-mingw-w64.patch b/src/libgcrypt-1-mingw-w64.patch index df09b24..634c3c6 100644 --- a/src/libgcrypt-1-mingw-w64.patch +++ b/src/libgcrypt-1-mingw-w64.patch @@ -1,46 +1,86 @@ This file is part of MXE. See index.html for further information. -These patches have been taken from http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git +From 147c86d57e45bc3d4cafddbde00c447ea4610c47 Mon Sep 17 00:00:00 2001 +From: Mark Brand <mabrand@mabrand.nl> +Date: Mon, 3 Jun 2013 11:24:12 +0200 +Subject: [PATCH 1/2] avoid accidental inclusion of old winsock.h -http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-mingw64-use-correct-datatype-for-GetProcessWorkingSet.patch +taken from http://permalink.gmane.org/gmane.comp.encryption.gpg.libgcrypt.devel/2834 ---- a/random/rndw32.c.orig 2011-07-04 19:11:18.137525831 +0200 -+++ b/random/rndw32.c 2011-07-04 19:11:40.785404249 +0200 -@@ -887,7 +887,7 @@ - { - HANDLE handle; - FILETIME creationTime, exitTime, kernelTime, userTime; -- DWORD minimumWorkingSetSize, maximumWorkingSetSize; -+ SIZE_T minimumWorkingSetSize, maximumWorkingSetSize; - - handle = GetCurrentThread (); - GetThreadTimes (handle, &creationTime, &exitTime, +/src/gcrypt.h.in:# include <winsock2.h> implicitly includes +windows.h. Avoid including windows.h explicitly before +winsock2.h, to avoid implicit inclusion of conflicting winsock.h +from windows.h. +diff --git a/random/rndw32.c b/random/rndw32.c +index f8a83b6..d6c8e34 100644 +--- a/random/rndw32.c ++++ b/random/rndw32.c +@@ -78,7 +78,6 @@ + #include <stdint.h> + #endif + +-#include <windows.h> + + + #include "types.h" +diff --git a/src/ath.h b/src/ath.h +index 8769551..1d6be15 100644 +--- a/src/ath.h ++++ b/src/ath.h +@@ -24,7 +24,6 @@ + #include <config.h> + + #ifdef _WIN32 +-# include <windows.h> + #else /* !_WIN32 */ + # ifdef HAVE_SYS_SELECT_H + # include <sys/select.h> +diff --git a/tests/benchmark.c b/tests/benchmark.c +index 106e01b..d7a6188 100644 +--- a/tests/benchmark.c ++++ b/tests/benchmark.c +@@ -25,7 +25,6 @@ + #include <time.h> + #include <stdarg.h> + #ifdef _WIN32 +-#include <windows.h> + #else + #include <sys/times.h> + #endif +-- +1.8.4.5 -http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-correct-def-file.patch ---- a/src/libgcrypt.def.orig 2012-02-28 00:16:33.422552508 +0100 -+++ b/src/libgcrypt.def 2012-02-28 00:16:59.188018940 +0100 -@@ -1,3 +1,4 @@ -+EXPORTS - ;; libgcrypt.defs - Exported symbols for W32 - ;; Copyright (C) 2003, 2007 Free Software Foundation, Inc. - ;; -@@ -22,7 +23,6 @@ - ;; never be changed. Also check libgcrypt.vers and visibility.h. +From 446a9c19d4c307e319a08633c08b2f62e69230fa Mon Sep 17 00:00:00 2001 +From: Tony Theodore <tonyt@logyst.com> +Date: Fri, 7 Feb 2014 21:22:10 +0100 +Subject: [PATCH 2/2] mingw-w64 compatibility + + +diff --git a/mpi/generic/mpi-asm-defs.h b/mpi/generic/mpi-asm-defs.h +index 13424e2..74a7501 100644 +--- a/mpi/generic/mpi-asm-defs.h ++++ b/mpi/generic/mpi-asm-defs.h +@@ -1,8 +1,11 @@ + /* This file defines some basic constants for the MPI machinery. We + * need to define the types on a per-CPU basis, so it is done with + * this file here. */ ++#ifdef _WIN64 ++#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG_LONG) ++#else + #define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG) +- ++#endif --EXPORTS - gcry_check_version @1 - gcry_control @2 - -http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-correct-asm-code-for-win64.patch - ---- a/mpi/mpi-internal.h.orig 2013-01-02 12:04:49.634772462 +0100 -+++ b/mpi/mpi-internal.h 2013-01-02 12:11:41.222744150 +0100 -@@ -168,6 +168,12 @@ +diff --git a/mpi/mpi-internal.h b/mpi/mpi-internal.h +index e75b7c6..a0f45e4 100644 +--- a/mpi/mpi-internal.h ++++ b/mpi/mpi-internal.h +@@ -168,6 +168,12 @@ typedef int mpi_size_t; /* (must be a signed type) */ } while (0) @@ -53,7 +93,7 @@ http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-corre /*-- 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 ); -@@ -186,7 +192,7 @@ +@@ -186,7 +192,7 @@ void _gcry_mpi_lshift_limbs( gcry_mpi_t a, unsigned int count ); 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, @@ -62,7 +102,7 @@ http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-corre 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); -@@ -194,7 +200,7 @@ +@@ -194,7 +200,7 @@ mpi_limb_t _gcry_mpih_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_siz 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, @@ -71,7 +111,7 @@ http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-corre 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); -@@ -216,9 +222,9 @@ +@@ -216,9 +222,9 @@ struct karatsuba_ctx { 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, @@ -83,7 +123,7 @@ http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-corre 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, -@@ -235,7 +241,7 @@ +@@ -235,7 +241,7 @@ void _gcry_mpih_mul_karatsuba_case( mpi_ptr_t prodp, /*-- 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, @@ -92,7 +132,7 @@ http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-corre /*-- mpih-div.c --*/ mpi_limb_t _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size, -@@ -249,9 +255,9 @@ +@@ -249,9 +255,9 @@ mpi_limb_t _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr, /*-- mpih-shift.c --*/ mpi_limb_t _gcry_mpih_lshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize, @@ -104,18 +144,36 @@ http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-corre /* Define stuff for longlong.h. */ ---- a/mpi/generic/mpi-asm-defs.h.orig 2013-01-02 15:07:53.540464492 +0100 -+++ b/mpi/generic/mpi-asm-defs.h 2013-01-02 15:08:16.720633878 +0100 -@@ -1,8 +1,11 @@ - /* This file defines some basic constants for the MPI machinery. We - * need to define the types on a per-CPU basis, so it is done with - * this file here. */ -+#ifdef _WIN64 -+#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG_LONG) -+#else - #define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG) -- -+#endif +diff --git a/random/rndw32.c b/random/rndw32.c +index d6c8e34..b3e34f9 100644 +--- a/random/rndw32.c ++++ b/random/rndw32.c +@@ -886,7 +886,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, + { + HANDLE handle; + FILETIME creationTime, exitTime, kernelTime, userTime; +- DWORD minimumWorkingSetSize, maximumWorkingSetSize; ++ SIZE_T minimumWorkingSetSize, maximumWorkingSetSize; + handle = GetCurrentThread (); + GetThreadTimes (handle, &creationTime, &exitTime, +diff --git a/src/libgcrypt.def b/src/libgcrypt.def +index 031b941..2f440c7 100644 +--- a/src/libgcrypt.def ++++ b/src/libgcrypt.def +@@ -1,3 +1,4 @@ ++EXPORTS + ;; libgcrypt.defs - Exported symbols for W32 + ;; Copyright (C) 2003, 2007 Free Software Foundation, Inc. + ;; +@@ -22,7 +23,6 @@ + ;; never be changed. Also check libgcrypt.vers and visibility.h. +-EXPORTS + gcry_check_version @1 + gcry_control @2 + +-- +1.8.4.5 + |