include: Introduce WINE_UNICODE_CHAR16 that allows using char16_t as Windows WCHAR.

This is useful for winelib applications that don't use -fshort-wchar.
They may use u"" for string literals and u16string. However, C++ has
builtin char16_t type, so we need WCHAR to be compatible with that.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Kevin Puetz 2020-02-11 19:52:22 +01:00 committed by Alexandre Julliard
parent d1373e8aae
commit c2679945dd
4 changed files with 16 additions and 7 deletions

View File

@ -28,8 +28,10 @@ extern "C" {
#endif
typedef unsigned char SQLCHAR;
#ifdef WINE_UNICODE_NATIVE
#if defined(WINE_UNICODE_NATIVE)
typedef wchar_t SQLWCHAR;
#elif defined(WINE_UNICODE_CHAR16)
typedef char16_t SQLWCHAR;
#else
typedef unsigned short SQLWCHAR;
#endif

View File

@ -244,8 +244,10 @@ typedef unsigned short wctype_t;
#endif
#ifndef __TCHAR_DEFINED
#ifdef WINE_UNICODE_NATIVE
#if defined(WINE_UNICODE_NATIVE)
typedef wchar_t _TCHAR;
#elif defined(WINE_UNICODE_CHAR16)
typedef char16_t _TCHAR;
#else
typedef unsigned short _TCHAR;
#endif

View File

@ -463,11 +463,14 @@ typedef int LONG, *PLONG;
#endif
/* Some systems might have wchar_t, but we really need 16 bit characters */
#ifdef WINE_UNICODE_NATIVE
typedef wchar_t WCHAR, *PWCHAR;
#if defined(WINE_UNICODE_NATIVE)
typedef wchar_t WCHAR;
#elif defined(WINE_UNICODE_CHAR16)
typedef char16_t WCHAR;
#else
typedef unsigned short WCHAR, *PWCHAR;
typedef unsigned short WCHAR;
#endif
typedef WCHAR *PWCHAR;
typedef ULONG UCSCHAR;
#define MIN_UCSCHAR (0)

View File

@ -24,10 +24,12 @@
* macro which only exists in the user's code.
*/
#ifndef WINE_NO_UNICODE_MACROS
# ifdef UNICODE
# ifndef UNICODE
# define __TEXT(string) string
# elif defined(WINE_UNICODE_NATIVE)
# define __TEXT(string) L##string
# else
# define __TEXT(string) string
# define __TEXT(string) u##string
# endif
# define TEXT(string) __TEXT(string)
#endif