w32: Hacks for building with 32 bit mingw64.

* configure.ac (INSERT__TYPEDEFS_FOR_GPGME_H): Add hacks for 32 bit
mingw64.
* src/util.h [W32]: Include winsock2.h before windows to make mingw64
happy.
* src/w32-util.c (_WIN32_IE): Need to use 5.1 for mingw64.
--

It is not clear to me what mingw64 wants to achieve with their POSIX
hacks. In particular the off64_t stuff looks quite strange given that
Windows has a pretty stable API for close to 2 decades.  Thus I can't
say whether it will really work when build with that toolchain.
This commit is contained in:
Werner Koch 2013-02-26 17:06:39 +01:00
parent 787b5f14b9
commit cdae524b28
3 changed files with 11 additions and 2 deletions

View File

@ -287,8 +287,12 @@ typedef long off_t;
typedef __int64 ssize_t;" typedef __int64 ssize_t;"
else else
INSERT__TYPEDEFS_FOR_GPGME_H="/* Typedefs for the 32 bit W32 API. */ 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 off_t;
typedef long ssize_t;" #endif
#ifndef _SSIZE_T_DEFINED /* Defined by newer mingw32 toolkits. */
typedef long ssize_t;
#endif"
fi fi
else else
INSERT__TYPEDEFS_FOR_GPGME_H="#include <sys/types.h>" INSERT__TYPEDEFS_FOR_GPGME_H="#include <sys/types.h>"

View File

@ -26,6 +26,7 @@
# ifdef HAVE_W32CE_SYSTEM # ifdef HAVE_W32CE_SYSTEM
# include "w32-ce.h" # include "w32-ce.h"
# else # else
# include "winsock2.h"
# include "windows.h" # include "windows.h"
# endif # endif
#endif #endif

View File

@ -44,7 +44,11 @@
#include <fcntl.h> #include <fcntl.h>
#include <io.h> #include <io.h>
#if __MINGW64_VERSION_MAJOR >= 2
# define _WIN32_IE 0x0501 /* Required by mingw64 toolkit. */
#else
# define _WIN32_IE 0x0400 /* Required for SHGetSpecialFolderPathA. */ # define _WIN32_IE 0x0400 /* Required for SHGetSpecialFolderPathA. */
#endif
/* We need to include the windows stuff here prior to shlobj.h so that /* 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 we get the right winsock version. This is usually done in util.h