Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2019-11-22 18:26:54 +0300
committermano-wii <germano.costa@ig.com.br>2019-11-22 18:27:34 +0300
commit177dfc6384b926dd19e3b7e98a995ccb4da9167c (patch)
tree865abe9f707bee039a506bfc17cb4cff218bd6c6 /source/blender/blenlib/BLI_sys_types.h
parent1304cee920c5f01fd9f0474ea782db61ac031403 (diff)
Fix T71273: Bad encoding of utf-8 for Text objects
`BLI_strncpy_wchar_from_utf8` internally assumes `wchar_t` is 32 bits which is not the case on windows. The solution is to replace `wchar_t` with `char32_t`. Thanks to @robbott for compatibility on macOS. Differential Revision: https://developer.blender.org/D6198
Diffstat (limited to 'source/blender/blenlib/BLI_sys_types.h')
-rw-r--r--source/blender/blenlib/BLI_sys_types.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_sys_types.h b/source/blender/blenlib/BLI_sys_types.h
index a82e6a562e0..354d27385a2 100644
--- a/source/blender/blenlib/BLI_sys_types.h
+++ b/source/blender/blenlib/BLI_sys_types.h
@@ -72,6 +72,15 @@ typedef uint64_t u_int64_t;
#include <stddef.h> /* size_t define */
#include <stdbool.h>
+#ifndef __cplusplus
+# if defined(__APPLE__)
+/* The <uchar.h> standard header is missing on macOS. */
+typedef unsigned int char32_t;
+# else
+# include <uchar.h>
+# endif
+#endif
+
typedef unsigned int uint;
typedef unsigned short ushort;
typedef unsigned long ulong;