msvcrt: define the BSD types (resent)
Dimitrie O. Paun
dpaun at rogers.com
Sun Mar 16 09:27:05 CST 2003
Alexandre,
This one seems to have fallen through the cracks...
Is there anything wrong with it?
---------- Forwarded Message ----------
Subject: msvcrt: define the BSD types
Date: Mon, 13 Jan 2003 21:20:03 -0500
From: "Dimitrie O. Paun" <dpaun at rogers.com>
To: Wine Patches <wine-patches at winehq.com>
Francois, if this patch gets applied, you will not need to
define these in winsock.h...
ChangeLog
Define the u_{char,short,int,long} in msvcrt/sys/types.h
for Unix compatibility (needed by winsock.h as well).
Index: include/msvcrt/sys/types.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/sys/types.h,v
retrieving revision 1.7
diff -u -r1.7 types.h
--- include/msvcrt/sys/types.h 11 Jan 2003 22:49:54 -0000 1.7
+++ include/msvcrt/sys/types.h 12 Jan 2003 16:13:54 -0000
@@ -55,6 +55,14 @@
#endif
#ifndef USE_MSVCRT_PREFIX
+#ifndef MSVCRT_BSD_TYPES_DEFINED
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+#define MSVCRT_BSD_TYPES_DEFINED
+#endif
+
#define dev_t _dev_t
#define ino_t _ino_t
#define mode_t _mode_t
Index: include/winsock.h
===================================================================
RCS file: /var/cvs/wine/include/winsock.h,v
retrieving revision 1.50
diff -u -r1.50 winsock.h
--- include/winsock.h 4 Jan 2003 00:52:19 -0000 1.50
+++ include/winsock.h 14 Jan 2003 01:47:25 -0000
@@ -57,25 +57,17 @@
* This section defines the items that conflict with the Unix headers.
*/
+# include <sys/types.h>
#ifndef __WINE_USE_MSVCRT
-/* Get the u_xxx types from the Unix headers. They will do and doing it
- * this way will avoid redefinitions. But on FreeBSD we may get macros
- * and prototypes for htonl & co. This means the functions will not be
- * called because of the macros. So this should not harm us too much unless
- * we try to define our own prototypes (different calling convention).
+/* On FreeBSD we may get macros and prototypes for htonl & co.
+ * This means the functions will not be called because of the macros.
+ * So this should not harm us too much unless we try to define our own
+ * prototypes (different calling convention).
*/
-# include <sys/types.h>
# if defined(USE_WS_PREFIX) || !defined(htonl)
# define WS_DEFINE_HTONL
# endif /* htonl */
#else
-/* Since we are using the MSVCRT headers, we must define the u_xxx
- * types ourselves.
- */
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-typedef unsigned int u_int;
-typedef unsigned long u_long;
# define WS_DEFINE_HTONL
#endif /* __WINE_USE_MSVCRT */
--
Dimi.
-------------------------------------------------------
--
Dimi.
More information about the wine-patches
mailing list