Patch: winsock.h problem

Martin Wilck Martin.Wilck at Fujitsu-Siemens.com
Thu Nov 21 03:47:06 CST 2002


Am Don, 2002-11-21 um 06.05 schrieb Dimitrie O. Paun:

> #include <winsock.h>
> #include <windows.h>
> 
> fails miserably in Wine (but apparently works in Windows)

> In file included from /home/dimi/dev/wine/wine.src/include/windows.h:62,
>                  from /home/dimi/dev/wine/wine.src/include/winsock.h:33,
>                  from winnet.c:46:
> /home/dimi/dev/wine/wine.src/include/winsock2.h:401: warning: type defaults to `int' in declaration of `SOCKET'

This is because of the "circular" include sequence
winsock.h -> windows.h -> winsock2.h -> winsock.h
where the last include doesn't "work" because _WINSOCKAPI_ is already
set.

The following patch fixes it.

Martin

Index: include/winsock.h
===================================================================
RCS file: /home/wine/wine/include/winsock.h,v
retrieving revision 1.47
diff -u -r1.47 winsock.h
--- include/winsock.h	30 Oct 2002 20:26:32 -0000	1.47
+++ include/winsock.h	21 Nov 2002 09:38:15 -0000
@@ -26,14 +26,14 @@
 # endif
 #endif
 
-#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_
-
 #ifndef __WINE__
 # include "windows.h"
 #else
 # include "windef.h"
 #endif
+
+#ifndef _WINSOCKAPI_
+#define _WINSOCKAPI_
 
 /*
  * Setup phase




More information about the wine-patches mailing list