diff options
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | src/util.h | 1 | ||||
-rw-r--r-- | src/w32-util.c | 6 |
3 files changed, 11 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index cfe6d1b1..0fb326e6 100644 --- a/configure.ac +++ b/configure.ac @@ -287,8 +287,12 @@ typedef long off_t; typedef __int64 ssize_t;" else INSERT__TYPEDEFS_FOR_GPGME_H="/* Typedefs for the 32 bit W32 API. */ +#ifndef _OFF_T_DEFINED /* Defined by newer mingw32 toolkits. */ typedef long off_t; -typedef long ssize_t;" +#endif +#ifndef _SSIZE_T_DEFINED /* Defined by newer mingw32 toolkits. */ +typedef long ssize_t; +#endif" fi else INSERT__TYPEDEFS_FOR_GPGME_H="#include <sys/types.h>" @@ -26,6 +26,7 @@ # ifdef HAVE_W32CE_SYSTEM # include "w32-ce.h" # else +# include "winsock2.h" # include "windows.h" # endif #endif diff --git a/src/w32-util.c b/src/w32-util.c index 7feaf6b9..a90f4056 100644 --- a/src/w32-util.c +++ b/src/w32-util.c @@ -44,7 +44,11 @@ #include <fcntl.h> #include <io.h> -#define _WIN32_IE 0x0400 /* Required for SHGetSpecialFolderPathA. */ +#if __MINGW64_VERSION_MAJOR >= 2 +# define _WIN32_IE 0x0501 /* Required by mingw64 toolkit. */ +#else +# define _WIN32_IE 0x0400 /* Required for SHGetSpecialFolderPathA. */ +#endif /* We need to include the windows stuff here prior to shlobj.h so that we get the right winsock version. This is usually done in util.h |