WineLib with MSVCRT

Martin Wilck Martin.Wilck at Fujitsu-Siemens.com
Tue Sep 17 02:35:52 CDT 2002


Am Mon, 2002-09-16 um 20.58 schrieb steve.lustbader at philips.com:

> Finally, if I don't use either -nostdinc or -nostdinc++,
> gcc complains about types being redefined, such as wint_t
> (as an unsigned short int in /usr/include/_G_config.h but
> WCHAR in /usr/local/include/wine/msvcrt/wctype.h).

I just stumbled into the same problem.

I worked around this by adding a few lines to the wine header
files - see patch below - and at least my code compiles now. I can't
tell if it runs, but it may be worth a try.

It may also depend on the gcc/libc versions installed, though :/
Perhaps someone with more insight into wide characters/libc/gcc
can comment.

--nostdinc obviously carries tons of problems, I've given up on it.

Martin

Index: include/msvcrt/wchar.h
===================================================================
RCS file: /home/wine/wine/include/msvcrt/wchar.h,v
retrieving revision 1.3
diff -u -r1.3 wchar.h
--- include/msvcrt/wchar.h	22 Oct 2001 18:59:23 -0000	1.3
+++ include/msvcrt/wchar.h	16 Sep 2002 16:25:12 -0000
@@ -24,7 +24,8 @@
 #define WCHAR_MIN 0
 #define WCHAR_MAX ((WCHAR)-1)
 
-typedef int MSVCRT(mbstate_t);
+typedef int MSVCRT(__mbstate_t);
+typedef MSVCRT(__mbstate_t) MSVCRT(mbstate_t);
 
 #ifndef MSVCRT_SIZE_T_DEFINED
 typedef unsigned int MSVCRT(size_t);
Index: include/msvcrt/wctype.h
===================================================================
RCS file: /home/wine/wine/include/msvcrt/wctype.h,v
retrieving revision 1.4
diff -u -r1.4 wctype.h
--- include/msvcrt/wctype.h	31 May 2002 23:06:50 -0000	1.4
+++ include/msvcrt/wctype.h	16 Sep 2002 16:25:12 -0000
@@ -66,6 +66,10 @@
 
 typedef WCHAR MSVCRT(wctype_t);
 typedef WCHAR MSVCRT(wint_t);
+#ifndef USE_MSVCRT_PREFIX
+/* prevent C++ standard library from redefining wint_t */
+#define _WINT_T
+#endif
 
 /* FIXME: there's something to do with __p__pctype and __p__pwctype */
 



-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1	    mailto:Martin.Wilck at Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy








More information about the wine-devel mailing list