`WINE_UNICODE_NATIVE` handles non-PE targets where appropriate, but on PE targets, we should always use `wchar_t`. This is particularly important for C++, where `wchar_t` is a distinct built-in type.
From: Jacek Caban jacek@codeweavers.com
WINE_UNICODE_NATIVE handles non-PE targets where appropriate, but on PE targets, we should always use wchar_t. This is particularly important for C++, where wchar_t is a distinct built-in type. --- include/sqltypes.h | 2 +- include/tchar.h | 2 +- include/winnt.h | 2 +- include/winnt.rh | 2 +- include/wtypes.idl | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/sqltypes.h b/include/sqltypes.h index 70315c271c4..44c1d4f4efc 100644 --- a/include/sqltypes.h +++ b/include/sqltypes.h @@ -28,7 +28,7 @@ extern "C" { #endif
typedef unsigned char SQLCHAR; -#if defined(WINE_UNICODE_NATIVE) +#if defined(WINE_UNICODE_NATIVE) || ((defined(__MINGW32__) || defined(_MSC_VER)) && defined(_WCHAR_T_DEFINED)) typedef wchar_t SQLWCHAR; #elif __cpp_unicode_literals >= 200710 typedef char16_t SQLWCHAR; diff --git a/include/tchar.h b/include/tchar.h index bbf85973b41..de1444fe865 100644 --- a/include/tchar.h +++ b/include/tchar.h @@ -248,7 +248,7 @@ typedef unsigned short wctype_t; #endif
#ifndef __TCHAR_DEFINED -#if defined(WINE_UNICODE_NATIVE) +#if defined(WINE_UNICODE_NATIVE) || defined(__MINGW32__) || defined(_MSC_VER) typedef wchar_t _TCHAR; #elif __cpp_unicode_literals >= 200710 typedef char16_t _TCHAR; diff --git a/include/winnt.h b/include/winnt.h index f671b7d64a5..31ee273d11d 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -476,7 +476,7 @@ typedef int LONG, *PLONG; #endif
/* Some systems might have wchar_t, but we really need 16 bit characters */ -#if defined(WINE_UNICODE_NATIVE) +#if defined(WINE_UNICODE_NATIVE) || defined(__MINGW32__) || defined(_MSC_VER) typedef wchar_t WCHAR; #elif __cpp_unicode_literals >= 200710 typedef char16_t WCHAR; diff --git a/include/winnt.rh b/include/winnt.rh index 38cefd61c53..366196ccb9c 100644 --- a/include/winnt.rh +++ b/include/winnt.rh @@ -26,7 +26,7 @@ #ifndef WINE_NO_UNICODE_MACROS # ifndef UNICODE # define __TEXT(string) string -# elif defined(WINE_UNICODE_NATIVE) +# elif defined(WINE_UNICODE_NATIVE) || defined(__MINGW32__) || defined(_MSC_VER) # define __TEXT(string) L##string # else # define __TEXT(string) u##string diff --git a/include/wtypes.idl b/include/wtypes.idl index 77a9f1c761a..188c650cae9 100644 --- a/include/wtypes.idl +++ b/include/wtypes.idl @@ -289,7 +289,7 @@ typedef WCHAR OLECHAR; typedef [string] OLECHAR *LPOLESTR; typedef [string] const OLECHAR *LPCOLESTR; cpp_quote("#ifndef __WINESRC__") -cpp_quote("# ifdef WINE_UNICODE_NATIVE") +cpp_quote("# if defined(WINE_UNICODE_NATIVE) || defined(__MINGW32__) || defined(_MSC_VER)") cpp_quote("# define OLESTR(str) L##str") cpp_quote("# else") cpp_quote("# define OLESTR(str) u##str")