"Dimitrie O. Paun" dpaun@rogers.com writes:
ChangeLog Fix the _WCHAR_T_DEFINED/_WCHAR_T_DEFINED sentries for compatibility with the MSVCRT ones.
Unfortunately _WCHAR_T_DEFINED is also used by gcc in stddef.h.
On Mon, 26 Apr 2004, Alexandre Julliard wrote:
"Dimitrie O. Paun" dpaun@rogers.com writes:
ChangeLog Fix the _WCHAR_T_DEFINED/_WCHAR_T_DEFINED sentries for compatibility with the MSVCRT ones.
Unfortunately _WCHAR_T_DEFINED is also used by gcc in stddef.h.
It's OK, I think my other patch needed only this part.
ChangeLog Dimitrie O. Paun dpaun@rogers.com Fix the _WCTYPE_T_DEFINED sentry for compatibility.
Index: include/msvcrt/ctype.h =================================================================== RCS file: /var/cvs/wine/include/msvcrt/ctype.h,v retrieving revision 1.5 diff -u -r1.5 ctype.h --- include/msvcrt/ctype.h 18 Jul 2003 22:57:15 -0000 1.5 +++ include/msvcrt/ctype.h 26 Apr 2004 21:17:33 -0000 @@ -40,10 +40,10 @@ # endif #endif /* USE_MSVCRT_PREFIX */
-#ifndef MSVCRT_WCTYPE_T_DEFINED -typedef MSVCRT(wchar_t) MSVCRT(wint_t); -typedef MSVCRT(wchar_t) MSVCRT(wctype_t); -#define MSVCRT_WCTYPE_T_DEFINED +#ifndef _WCTYPE_T_DEFINED +typedef unsigned short MSVCRT(wint_t); +typedef unsigned short MSVCRT(wctype_t); +#define _WCTYPE_T_DEFINED #endif
/* ASCII char classification table - binary compatible */ Index: include/msvcrt/stdio.h =================================================================== RCS file: /var/cvs/wine/include/msvcrt/stdio.h,v retrieving revision 1.17 diff -u -r1.17 stdio.h --- include/msvcrt/stdio.h 16 Mar 2004 19:17:11 -0000 1.17 +++ include/msvcrt/stdio.h 26 Apr 2004 21:17:34 -0000 @@ -129,10 +129,10 @@ #endif #endif
-#ifndef MSVCRT_WCTYPE_T_DEFINED -typedef MSVCRT(wchar_t) MSVCRT(wint_t); -typedef MSVCRT(wchar_t) MSVCRT(wctype_t); -#define MSVCRT_WCTYPE_T_DEFINED +#ifndef _WCTYPE_T_DEFINED +typedef unsigned short MSVCRT(wint_t); +typedef unsigned short MSVCRT(wctype_t); +#define _WCTYPE_T_DEFINED #endif
#ifdef __cplusplus Index: include/msvcrt/wchar.h =================================================================== RCS file: /var/cvs/wine/include/msvcrt/wchar.h,v retrieving revision 1.7 diff -u -r1.7 wchar.h --- include/msvcrt/wchar.h 25 Mar 2004 00:10:06 -0000 1.7 +++ include/msvcrt/wchar.h 26 Apr 2004 21:17:34 -0000 @@ -50,10 +50,10 @@ #define MSVCRT_SIZE_T_DEFINED #endif
-#ifndef MSVCRT_WCTYPE_T_DEFINED -typedef MSVCRT(wchar_t) MSVCRT(wint_t); -typedef MSVCRT(wchar_t) MSVCRT(wctype_t); -#define MSVCRT_WCTYPE_T_DEFINED +#ifndef _WCTYPE_T_DEFINED +typedef unsigned short MSVCRT(wint_t); +typedef unsigned short MSVCRT(wctype_t); +#define _WCTYPE_T_DEFINED #endif
#ifndef _MSC_VER Index: include/msvcrt/wctype.h =================================================================== RCS file: /var/cvs/wine/include/msvcrt/wctype.h,v retrieving revision 1.6 diff -u -r1.6 wctype.h --- include/msvcrt/wctype.h 18 Jul 2003 22:57:15 -0000 1.6 +++ include/msvcrt/wctype.h 26 Apr 2004 21:17:34 -0000 @@ -60,10 +60,10 @@ # endif #endif /* USE_MSVCRT_PREFIX */
-#ifndef MSVCRT_WCTYPE_T_DEFINED -typedef MSVCRT(wchar_t) MSVCRT(wint_t); -typedef MSVCRT(wchar_t) MSVCRT(wctype_t); -#define MSVCRT_WCTYPE_T_DEFINED +#ifndef _WCTYPE_T_DEFINED +typedef unsigned short MSVCRT(wint_t); +typedef unsigned short MSVCRT(wctype_t); +#define _WCTYPE_T_DEFINED #endif
/* FIXME: there's something to do with __p__pctype and __p__pwctype */
On Mon, 26 Apr 2004, Alexandre Julliard wrote:
Unfortunately _WCHAR_T_DEFINED is also used by gcc in stddef.h.
Hmmm, thinking about it, even more so, shouldn't we also be compatible with that? I mean, if it was defined by them, we shouldn't define it again, no?
Currently we have this:
#ifndef MSVCRT_WCHAR_T_DEFINED #define MSVCRT_WCHAR_T_DEFINED #ifndef __cplusplus typedef unsigned short MSVCRT(wchar_t); #endif #endif
Maybe we need to transform this to:
#ifndef _WCHAR_T_DEFINED #define _WCHAR_T_DEFINED /* hmmm, shouldn't we also deal with WINE_UNICODE_NATIVE? */ typedef unsigned short wchar_t; #endif
#if defined(MSVCRT) && !defined(MSVCRT_WCHAR_T_DEFINED) #define MSVCRT_WCHAR_T_DEFINED typedef unsigned short MSVCRT(wchar_t); #endif
This is getting tiredsome -- why not have a wine/msvcrt.h header to put all this stuff into? We aren't breaking any compatibility, since we don't include any other header, we're just defining what we define inline anyway.
"Dimitrie O. Paun" dimi@intelliware.ca writes:
Hmmm, thinking about it, even more so, shouldn't we also be compatible with that? I mean, if it was defined by them, we shouldn't define it again, no?
It shouldn't hurt to redefine it, unless the definitions are not compatible, in which case we are in big trouble anyway.
This is getting tiredsome -- why not have a wine/msvcrt.h header to put all this stuff into? We aren't breaking any compatibility, since we don't include any other header, we're just defining what we define inline anyway.
No, I think it's much cleaner to keep the standard headers independent from Wine.