[2/2] server: Don't include winsock.h to avoid creating a dependency on generated headers.
Francois Gouget
fgouget at codeweavers.com
Fri Mar 19 04:16:04 CDT 2010
The dependency does not really exist thanks to various #ifdefs, but
makedep does not know that and records it which causes a build failure.
---
The build failure was as follows:
./configure
make depend
make -j1
With a parallel build, one make instance would usually enter include/
and generate the headers before the other got around to building sock.o
in server/. But with make -j1 we would get into server/ first and find
that sock.c's ../include/wtypes.h dependency did not exist and abort.
server/sock.c | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/server/sock.c b/server/sock.c
index ed89ca2..486d3bf 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -51,6 +51,7 @@
#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
+#include "winerror.h"
#include "process.h"
#include "file.h"
@@ -59,11 +60,36 @@
#include "request.h"
#include "user.h"
-/* To avoid conflicts with the Unix socket headers. Plus we only need a few
- * macros anyway.
+/* From winsock.h */
+#define FD_MAX_EVENTS 10
+#define FD_READ_BIT 0
+#define FD_WRITE_BIT 1
+#define FD_OOB_BIT 2
+#define FD_ACCEPT_BIT 3
+#define FD_CONNECT_BIT 4
+#define FD_CLOSE_BIT 5
+
+/*
+ * Define flags to be used with the WSAAsyncSelect() call.
*/
-#define USE_WS_PREFIX
-#include "winsock2.h"
+#define FD_READ 0x00000001
+#define FD_WRITE 0x00000002
+#define FD_OOB 0x00000004
+#define FD_ACCEPT 0x00000008
+#define FD_CONNECT 0x00000010
+#define FD_CLOSE 0x00000020
+
+/* internal per-socket flags */
+#ifdef __WINESRC__
+#define FD_WINE_LISTENING 0x10000000
+#define FD_WINE_NONBLOCKING 0x20000000
+#define FD_WINE_CONNECTED 0x40000000
+#define FD_WINE_RAW 0x80000000
+#define FD_WINE_INTERNAL 0xFFFF0000
+#endif
+
+/* Constants for WSAIoctl() */
+#define WSA_FLAG_OVERLAPPED 0x01
struct sock
{
--
1.6.5
More information about the wine-patches
mailing list