[PATCH 1/4] include: Always use the WS_* prefix on Unix.

Zebediah Figura zfigura at codeweavers.com
Mon Jan 10 17:31:04 CST 2022


From: Alexandre Julliard <julliard at winehq.org>

This removes the ability to use Windows sockets on Unix.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52250
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---

Extended from the original revision to include all headers that interpret
USE_WS_PREFIX, not just the main socket ones. Note that in particular inaddr.h
can be included by iphlpapi.h without requiring winsock.h or winsock2.h.

It seems more than a little tempting to define a Wine-internal header to take
care of both this and defining the WS() macro...

 include/af_irda.h  | 4 ++++
 include/in6addr.h  | 4 ++++
 include/inaddr.h   | 4 ++++
 include/mswsock.h  | 4 ++++
 include/winsock.h  | 4 ++++
 include/winsock2.h | 4 ++++
 include/wsipx.h    | 4 ++++
 include/wsnwlink.h | 4 ++++
 8 files changed, 32 insertions(+)

diff --git a/include/af_irda.h b/include/af_irda.h
index 3be5b39af02..6a6dca83079 100644
--- a/include/af_irda.h
+++ b/include/af_irda.h
@@ -18,6 +18,10 @@
 #ifndef AF_IRDA_H
 #define AF_IRDA_H
 
+#if !defined(USE_WS_PREFIX) && !defined(__MINGW32__) && !defined (_MSC_VER) && !defined(__WINE_USE_MSVCRT)
+#define USE_WS_PREFIX
+#endif
+
 typedef struct _IRDA_DEVICE_INFO
 {
     UCHAR irdaDeviceID[4];
diff --git a/include/in6addr.h b/include/in6addr.h
index a745bd249fa..663478fea12 100644
--- a/include/in6addr.h
+++ b/include/in6addr.h
@@ -19,6 +19,10 @@
 #ifndef __IN6ADDR__
 #define __IN6ADDR__
 
+#if !defined(USE_WS_PREFIX) && !defined(__MINGW32__) && !defined (_MSC_VER) && !defined(__WINE_USE_MSVCRT)
+#define USE_WS_PREFIX
+#endif
+
 #ifdef USE_WS_PREFIX
 #define WS(x)    WS_##x
 #else
diff --git a/include/inaddr.h b/include/inaddr.h
index 72a50284092..078c031ad0d 100644
--- a/include/inaddr.h
+++ b/include/inaddr.h
@@ -20,6 +20,10 @@
 #ifndef __INADDR_H__
 #define __INADDR_H__
 
+#if !defined(USE_WS_PREFIX) && !defined(__MINGW32__) && !defined (_MSC_VER) && !defined(__WINE_USE_MSVCRT)
+#define USE_WS_PREFIX
+#endif
+
 #ifdef USE_WS_PREFIX
 #define WS(x)    WS_##x
 #else
diff --git a/include/mswsock.h b/include/mswsock.h
index fa97d5bf04d..4afd8a7ceb1 100644
--- a/include/mswsock.h
+++ b/include/mswsock.h
@@ -18,6 +18,10 @@
 #ifndef _MSWSOCK_
 #define _MSWSOCK_
 
+#if !defined(USE_WS_PREFIX) && !defined(__MINGW32__) && !defined (_MSC_VER) && !defined(__WINE_USE_MSVCRT)
+#define USE_WS_PREFIX
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* defined(__cplusplus) */
diff --git a/include/winsock.h b/include/winsock.h
index b8a7a4ec400..6afe00e8bd7 100644
--- a/include/winsock.h
+++ b/include/winsock.h
@@ -24,6 +24,10 @@
 # error Please use winsock2 in Wine
 #endif
 
+#if !defined(USE_WS_PREFIX) && !defined(__MINGW32__) && !defined (_MSC_VER) && !defined(__WINE_USE_MSVCRT)
+#define USE_WS_PREFIX
+#endif
+
 #ifndef __WINE_WINSOCKAPI_STDLIB_H
 #define __WINE_WINSOCKAPI_STDLIB_H
 
diff --git a/include/winsock2.h b/include/winsock2.h
index f1d43acad40..9923ea0f6d1 100644
--- a/include/winsock2.h
+++ b/include/winsock2.h
@@ -19,6 +19,10 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#if !defined(USE_WS_PREFIX) && !defined(__MINGW32__) && !defined (_MSC_VER) && !defined(__WINE_USE_MSVCRT)
+#define USE_WS_PREFIX
+#endif
+
 #ifndef __WINE_WINSOCKAPI_STDLIB_H
 #define __WINE_WINSOCKAPI_STDLIB_H
 
diff --git a/include/wsipx.h b/include/wsipx.h
index 671e7563470..56395e26456 100644
--- a/include/wsipx.h
+++ b/include/wsipx.h
@@ -19,6 +19,10 @@
 #ifndef _WINE_WSIPX_
 #define _WINE_WSIPX_
 
+#if !defined(USE_WS_PREFIX) && !defined(__MINGW32__) && !defined (_MSC_VER) && !defined(__WINE_USE_MSVCRT)
+#define USE_WS_PREFIX
+#endif
+
 #ifdef USE_WS_PREFIX
 # define WS(x)    WS_##x
 #else
diff --git a/include/wsnwlink.h b/include/wsnwlink.h
index f237f0d1de5..161f9366df8 100644
--- a/include/wsnwlink.h
+++ b/include/wsnwlink.h
@@ -19,6 +19,10 @@
 #ifndef _WSNWLINK_
 #define _WSNWLINK_
 
+#if !defined(USE_WS_PREFIX) && !defined(__MINGW32__) && !defined (_MSC_VER) && !defined(__WINE_USE_MSVCRT)
+#define USE_WS_PREFIX
+#endif
+
 #ifdef USE_WS_PREFIX
 #define WS(x)    WS_##x
 #else
-- 
2.34.1




More information about the wine-devel mailing list