[PATCH 1/5] include: Fix undefined char16_t with -DWINE_UNICODE_CHAR16.

Puetz Kevin A PuetzKevinA at JohnDeere.com
Thu Jul 16 20:09:34 CDT 2020


In c++11 char16_t is a built-in fundamental type,
but in c11 it is a typedef from <uchar.h>

Signed-off-by: Kevin Puetz <PuetzKevinA at JohnDeere.com>
---
 include/sqltypes.h | 3 +++
 include/tchar.h    | 3 +++
 include/winnt.h    | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/include/sqltypes.h b/include/sqltypes.h
index 0923f6b362..8d406df562 100644
--- a/include/sqltypes.h
+++ b/include/sqltypes.h
@@ -31,6 +31,9 @@ typedef unsigned char   SQLCHAR;
 #if defined(WINE_UNICODE_NATIVE)
 typedef wchar_t         SQLWCHAR;
 #elif defined(WINE_UNICODE_CHAR16)
+# if !defined(__cplusplus) && !defined(RC_INVOKED)
+#  include <uchar.h> /* Bring in char16_t and char32_t for C */
+# endif
 typedef char16_t        SQLWCHAR;
 #else
 typedef unsigned short  SQLWCHAR;
diff --git a/include/tchar.h b/include/tchar.h
index 9fc4c72099..56f876bf84 100644
--- a/include/tchar.h
+++ b/include/tchar.h
@@ -241,6 +241,9 @@ typedef unsigned short wctype_t;
 #if defined(WINE_UNICODE_NATIVE)
 typedef wchar_t       _TCHAR;
 #elif defined(WINE_UNICODE_CHAR16)
+# if !defined(__cplusplus) && !defined(RC_INVOKED)
+#  include <uchar.h> /* Bring in char16_t and char32_t for C */
+# endif
 typedef char16_t      _TCHAR;
 #else
 typedef unsigned short _TCHAR;
diff --git a/include/winnt.h b/include/winnt.h
index e1cf78420a..126135eca2 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -463,6 +463,9 @@ typedef int             LONG,       *PLONG;
 #if defined(WINE_UNICODE_NATIVE)
 typedef wchar_t         WCHAR;
 #elif defined(WINE_UNICODE_CHAR16)
+# if !defined(__cplusplus) && !defined(RC_INVOKED)
+#  include <uchar.h> /* Bring in char16_t and char32_t for C */
+# endif
 typedef char16_t        WCHAR;
 #else
 typedef unsigned short  WCHAR;
-- 
2.27.0.windows.1




More information about the wine-devel mailing list