Commit c2679945 authored by Kevin Puetz's avatar Kevin Puetz Committed by Alexandre Julliard

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: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d1373e8a
...@@ -28,8 +28,10 @@ extern "C" { ...@@ -28,8 +28,10 @@ extern "C" {
#endif #endif
typedef unsigned char SQLCHAR; typedef unsigned char SQLCHAR;
#ifdef WINE_UNICODE_NATIVE #if defined(WINE_UNICODE_NATIVE)
typedef wchar_t SQLWCHAR; typedef wchar_t SQLWCHAR;
#elif defined(WINE_UNICODE_CHAR16)
typedef char16_t SQLWCHAR;
#else #else
typedef unsigned short SQLWCHAR; typedef unsigned short SQLWCHAR;
#endif #endif
......
...@@ -244,8 +244,10 @@ typedef unsigned short wctype_t; ...@@ -244,8 +244,10 @@ typedef unsigned short wctype_t;
#endif #endif
#ifndef __TCHAR_DEFINED #ifndef __TCHAR_DEFINED
#ifdef WINE_UNICODE_NATIVE #if defined(WINE_UNICODE_NATIVE)
typedef wchar_t _TCHAR; typedef wchar_t _TCHAR;
#elif defined(WINE_UNICODE_CHAR16)
typedef char16_t _TCHAR;
#else #else
typedef unsigned short _TCHAR; typedef unsigned short _TCHAR;
#endif #endif
......
...@@ -463,11 +463,14 @@ typedef int LONG, *PLONG; ...@@ -463,11 +463,14 @@ typedef int LONG, *PLONG;
#endif #endif
/* Some systems might have wchar_t, but we really need 16 bit characters */ /* Some systems might have wchar_t, but we really need 16 bit characters */
#ifdef WINE_UNICODE_NATIVE #if defined(WINE_UNICODE_NATIVE)
typedef wchar_t WCHAR, *PWCHAR; typedef wchar_t WCHAR;
#elif defined(WINE_UNICODE_CHAR16)
typedef char16_t WCHAR;
#else #else
typedef unsigned short WCHAR, *PWCHAR; typedef unsigned short WCHAR;
#endif #endif
typedef WCHAR *PWCHAR;
typedef ULONG UCSCHAR; typedef ULONG UCSCHAR;
#define MIN_UCSCHAR (0) #define MIN_UCSCHAR (0)
......
...@@ -24,10 +24,12 @@ ...@@ -24,10 +24,12 @@
* macro which only exists in the user's code. * macro which only exists in the user's code.
*/ */
#ifndef WINE_NO_UNICODE_MACROS #ifndef WINE_NO_UNICODE_MACROS
# ifdef UNICODE # ifndef UNICODE
# define __TEXT(string) string
# elif defined(WINE_UNICODE_NATIVE)
# define __TEXT(string) L##string # define __TEXT(string) L##string
# else # else
# define __TEXT(string) string # define __TEXT(string) u##string
# endif # endif
# define TEXT(string) __TEXT(string) # define TEXT(string) __TEXT(string)
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment