[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-cvs
Subject: =?UTF-8?Q?Kevin_Puetz_=3A_include=3A_Fix_undefined_char16=5Ft_in_C11=2E?=
From: Alexandre Julliard <julliard () winehq ! org>
Date: 2020-09-30 19:35:31
Message-ID: E1kNhsx-0002jM-7Q () winehq ! org
[Download RAW message or body]
Module: wine
Branch: master
Commit: d45b3d4fdd7cbcfdba70c327ab90976a3b658da2
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d45b3d4fdd7cbcfdba70c327ab90976a3b658da2
Author: Kevin Puetz <PuetzKevinA@JohnDeere.com>
Date: Thu Sep 24 10:12:09 2020 -0500
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 <uchar.h>.
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 <PuetzKevinA@JohnDeere.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
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 0923f6b362..4c45de7e98 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 9fc4c72099..a8e64b4bf6 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 f59a63c041..10b3253923 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;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic