diff --git a/windows/gss.c b/windows/gss.c index cadb1d5b..646e17fc 100644 --- a/windows/gss.c +++ b/windows/gss.c @@ -227,7 +227,8 @@ struct ssh_gss_liblist *ssh_gss_setup(Conf *conf) lib->gsslogmsg = "Using SSPI from SECUR32.DLL"; lib->handle = (void *)module; - GET_WINDOWS_FUNCTION(module, AcquireCredentialsHandleA); + /* No typecheck because Winelib thinks one PVOID is a PLUID */ + GET_WINDOWS_FUNCTION_NO_TYPECHECK(module, AcquireCredentialsHandleA); GET_WINDOWS_FUNCTION(module, InitializeSecurityContextA); GET_WINDOWS_FUNCTION(module, FreeContextBuffer); GET_WINDOWS_FUNCTION(module, FreeCredentialsHandle); diff --git a/windows/jump-list.c b/windows/jump-list.c index 43c1e66d..37a17cc9 100644 --- a/windows/jump-list.c +++ b/windows/jump-list.c @@ -41,7 +41,7 @@ typedef struct _tagpropertykey { typedef PROPVARIANT *REFPROPVARIANT; #endif /* MinGW doesn't define this yet: */ -#ifndef _PROPVARIANTINIT_DEFINED_ +#if !defined _PROPVARIANTINIT_DEFINED_ && !defined _PROPVARIANT_INIT_DEFINED_ #define _PROPVARIANTINIT_DEFINED_ #define PropVariantInit(pvar) memset((pvar),0,sizeof(PROPVARIANT)) #endif diff --git a/windows/network.c b/windows/network.c index a07b46bd..4bb8dde3 100644 --- a/windows/network.c +++ b/windows/network.c @@ -180,16 +180,16 @@ static int cmpforsearch(void *av, void *bv) DECL_WINDOWS_FUNCTION(static, int, WSAStartup, (WORD, LPWSADATA)); DECL_WINDOWS_FUNCTION(static, int, WSACleanup, (void)); DECL_WINDOWS_FUNCTION(static, int, closesocket, (SOCKET)); -DECL_WINDOWS_FUNCTION(static, u_long, ntohl, (u_long)); -DECL_WINDOWS_FUNCTION(static, u_long, htonl, (u_long)); -DECL_WINDOWS_FUNCTION(static, u_short, htons, (u_short)); -DECL_WINDOWS_FUNCTION(static, u_short, ntohs, (u_short)); +DECL_WINDOWS_FUNCTION(static, ULONG, ntohl, (ULONG)); +DECL_WINDOWS_FUNCTION(static, ULONG, htonl, (ULONG)); +DECL_WINDOWS_FUNCTION(static, USHORT, htons, (USHORT)); +DECL_WINDOWS_FUNCTION(static, USHORT, ntohs, (USHORT)); DECL_WINDOWS_FUNCTION(static, int, gethostname, (char *, int)); DECL_WINDOWS_FUNCTION(static, struct hostent FAR *, gethostbyname, (const char FAR *)); DECL_WINDOWS_FUNCTION(static, struct servent FAR *, getservbyname, (const char FAR *, const char FAR *)); -DECL_WINDOWS_FUNCTION(static, unsigned long, inet_addr, (const char FAR *)); +DECL_WINDOWS_FUNCTION(static, ULONG, inet_addr, (const char FAR *)); DECL_WINDOWS_FUNCTION(static, char FAR *, inet_ntoa, (struct in_addr)); DECL_WINDOWS_FUNCTION(static, const char FAR *, inet_ntop, (int, void FAR *, char *, size_t)); @@ -204,7 +204,7 @@ DECL_WINDOWS_FUNCTION(static, int, listen, (SOCKET, int)); DECL_WINDOWS_FUNCTION(static, int, send, (SOCKET, const char FAR *, int, int)); DECL_WINDOWS_FUNCTION(static, int, shutdown, (SOCKET, int)); DECL_WINDOWS_FUNCTION(static, int, ioctlsocket, - (SOCKET, long, u_long FAR *)); + (SOCKET, LONG, ULONG FAR *)); DECL_WINDOWS_FUNCTION(static, SOCKET, accept, (SOCKET, struct sockaddr FAR *, int FAR *)); DECL_WINDOWS_FUNCTION(static, int, getpeername, @@ -305,10 +305,12 @@ void sk_init(void) GET_WINDOWS_FUNCTION(winsock_module, WSAStartup); GET_WINDOWS_FUNCTION(winsock_module, WSACleanup); GET_WINDOWS_FUNCTION(winsock_module, closesocket); - GET_WINDOWS_FUNCTION(winsock_module, ntohl); - GET_WINDOWS_FUNCTION(winsock_module, htonl); - GET_WINDOWS_FUNCTION(winsock_module, htons); - GET_WINDOWS_FUNCTION(winsock_module, ntohs); + /* Winelib maps ntohl and friends to things like + * __wine_ulong_swap, which fail these type checks hopelessly */ + GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, ntohl); + GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, htonl); + GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, htons); + GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, ntohs); GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, gethostname); GET_WINDOWS_FUNCTION(winsock_module, gethostbyname); GET_WINDOWS_FUNCTION(winsock_module, getservbyname); diff --git a/windows/platform.h b/windows/platform.h index 4e3b63f1..c33ca1c4 100644 --- a/windows/platform.h +++ b/windows/platform.h @@ -306,9 +306,9 @@ Socket *sk_newlistener_unix(const char *socketpath, Plug *plug); * here they are. */ DECL_WINDOWS_FUNCTION(extern, int, WSAAsyncSelect, - (SOCKET, HWND, u_int, long)); + (SOCKET, HWND, u_int, LONG)); DECL_WINDOWS_FUNCTION(extern, int, WSAEventSelect, - (SOCKET, WSAEVENT, long)); + (SOCKET, WSAEVENT, LONG)); DECL_WINDOWS_FUNCTION(extern, int, WSAGetLastError, (void)); DECL_WINDOWS_FUNCTION(extern, int, WSAEnumNetworkEvents, (SOCKET, WSAEVENT, LPWSANETWORKEVENTS)); diff --git a/windows/window.c b/windows/window.c index bd13d228..59c56ee1 100644 --- a/windows/window.c +++ b/windows/window.c @@ -9,6 +9,7 @@ #include #include #include +#include #define COMPILE_MULTIMON_STUBS