1.1 --- a/src/pgp_gpg.c Wed Apr 22 23:14:04 2015 +0200
1.2 +++ b/src/pgp_gpg.c Thu Apr 23 17:24:27 2015 +0200
1.3 @@ -4,6 +4,11 @@
1.4
1.5 #include <limits.h>
1.6
1.7 +#ifdef WIN32
1.8 +#include <winsock2.h>
1.9 +#pragma comment(lib, "Ws2_32.lib")
1.10 +#endif
1.11 +
1.12 #include "wrappers.h"
1.13
1.14 #define _GPGERR(X) ((X) & 0xffffL)
1.15 @@ -1347,6 +1352,10 @@
1.16 const char *date_ref;
1.17 } renew_state;
1.18
1.19 +#ifdef WIN32
1.20 +#define write(A, B, C) send((A), (B), (C), 0)
1.21 +#endif
1.22 +
1.23 static gpgme_error_t renew_fsm(
1.24 void *_handle,
1.25 gpgme_status_code_t statuscode,
1.26 @@ -1451,6 +1460,10 @@
1.27 return GPG_ERR_NO_ERROR;
1.28 }
1.29
1.30 +#ifdef WIN32
1.31 +#undef write
1.32 +#endif
1.33 +
1.34 static ssize_t _nullwriter(
1.35 void *_handle,
1.36 const void *buffer,
1.37 @@ -1528,6 +1541,10 @@
1.38 return true;
1.39 }
1.40
1.41 +#ifdef WIN32
1.42 +#define write(A, B, C) send((A), (B), (C), 0)
1.43 +#endif
1.44 +
1.45 static gpgme_error_t revoke_fsm(
1.46 void *_handle,
1.47 gpgme_status_code_t statuscode,
1.48 @@ -1646,6 +1663,10 @@
1.49 return GPG_ERR_NO_ERROR;
1.50 }
1.51
1.52 +#ifdef WIN32
1.53 +#undef write
1.54 +#endif
1.55 +
1.56 PEP_STATUS pgp_revoke_key(
1.57 PEP_SESSION session,
1.58 const char *fpr,