From d45b3d4fdd7cbcfdba70c327ab90976a3b658da2 Mon Sep 17 00:00:00 2001 From: Kevin Puetz Date: Thu, 24 Sep 2020 10:12:09 -0500 Subject: [PATCH] include: Fix undefined char16_t in C11. In c++11 char16_t is a distinct fundamental type, but in c11 it is merely a typedef in . Explicitly mention char16_t only in c++11 (where it is built-in), otherwise define WCHAR as unsigned short (without naming char16_t) and just hope that on C11 this matches u"..." Remove WINE_UNICODE_CHAR16; it is now the default when supported. Signed-off-by: Kevin Puetz Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- include/sqltypes.h | 2 +- include/tchar.h | 2 +- include/winnt.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sqltypes.h b/include/sqltypes.h index 0923f6b3626..4c45de7e989 100644 --- a/include/sqltypes.h +++ b/include/sqltypes.h @@ -30,7 +30,7 @@ extern "C" { typedef unsigned char SQLCHAR; #if defined(WINE_UNICODE_NATIVE) typedef wchar_t SQLWCHAR; -#elif defined(WINE_UNICODE_CHAR16) +#elif __cpp_unicode_literals >= 200710 typedef char16_t SQLWCHAR; #else typedef unsigned short SQLWCHAR; diff --git a/include/tchar.h b/include/tchar.h index 9fc4c720999..a8e64b4bf6a 100644 --- a/include/tchar.h +++ b/include/tchar.h @@ -240,7 +240,7 @@ typedef unsigned short wctype_t; #ifndef __TCHAR_DEFINED #if defined(WINE_UNICODE_NATIVE) typedef wchar_t _TCHAR; -#elif defined(WINE_UNICODE_CHAR16) +#elif __cpp_unicode_literals >= 200710 typedef char16_t _TCHAR; #else typedef unsigned short _TCHAR; diff --git a/include/winnt.h b/include/winnt.h index f59a63c0410..10b3253923b 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -462,7 +462,7 @@ typedef int LONG, *PLONG; /* Some systems might have wchar_t, but we really need 16 bit characters */ #if defined(WINE_UNICODE_NATIVE) typedef wchar_t WCHAR; -#elif defined(WINE_UNICODE_CHAR16) +#elif __cpp_unicode_literals >= 200710 typedef char16_t WCHAR; #else typedef unsigned short WCHAR;