This is an automated email from the ASF dual-hosted git repository. yamamoto pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 635752389226ad005f52524a933acf864c1a1f8d Author: Xiang Xiao <xiaoxi...@xiaomi.com> AuthorDate: Mon Nov 1 12:40:51 2021 +0800 arch: Add _wchar_t typedef like other basic types Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com> --- arch/arm/include/types.h | 6 ++++++ arch/avr/include/avr/types.h | 6 ++++++ arch/avr/include/avr32/types.h | 6 ++++++ arch/hc/include/hc12/types.h | 6 ++++++ arch/hc/include/hcs12/types.h | 6 ++++++ arch/mips/include/types.h | 6 ++++++ arch/misoc/include/types.h | 6 ++++++ arch/or1k/include/types.h | 6 ++++++ arch/renesas/include/m16c/types.h | 6 ++++++ arch/renesas/include/rx65n/types.h | 6 ++++++ arch/renesas/include/sh1/types.h | 6 ++++++ arch/risc-v/include/types.h | 6 ++++++ arch/sim/include/types.h | 6 ++++++ arch/x86/include/i486/types.h | 6 ++++++ arch/x86_64/include/intel64/types.h | 6 ++++++ arch/xtensa/include/types.h | 6 ++++++ arch/z16/include/types.h | 6 ++++++ arch/z80/include/ez80/types.h | 6 ++++++ arch/z80/include/z180/types.h | 6 ++++++ arch/z80/include/z8/types.h | 6 ++++++ arch/z80/include/z80/types.h | 6 ++++++ include/sys/types.h | 4 ++-- 22 files changed, 128 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/types.h b/arch/arm/include/types.h index 32052c8..a14c450 100644 --- a/arch/arm/include/types.h +++ b/arch/arm/include/types.h @@ -66,6 +66,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/avr/include/avr/types.h b/arch/avr/include/avr/types.h index 7bd220e..6dedd3d 100644 --- a/arch/avr/include/avr/types.h +++ b/arch/avr/include/avr/types.h @@ -67,6 +67,12 @@ typedef double double_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A (near) size is 2 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/avr/include/avr32/types.h b/arch/avr/include/avr32/types.h index 8f7fbbf..ec18719 100644 --- a/arch/avr/include/avr32/types.h +++ b/arch/avr/include/avr32/types.h @@ -64,6 +64,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/hc/include/hc12/types.h b/arch/hc/include/hc12/types.h index 985c885..85b0808 100644 --- a/arch/hc/include/hc12/types.h +++ b/arch/hc/include/hc12/types.h @@ -73,6 +73,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is two bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/hc/include/hcs12/types.h b/arch/hc/include/hcs12/types.h index 826a76d..da9ec26 100644 --- a/arch/hc/include/hcs12/types.h +++ b/arch/hc/include/hcs12/types.h @@ -74,6 +74,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is two bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/mips/include/types.h b/arch/mips/include/types.h index a149973..de4870b 100644 --- a/arch/mips/include/types.h +++ b/arch/mips/include/types.h @@ -64,6 +64,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/misoc/include/types.h b/arch/misoc/include/types.h index ed873e0..a6d27b0 100644 --- a/arch/misoc/include/types.h +++ b/arch/misoc/include/types.h @@ -64,6 +64,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/or1k/include/types.h b/arch/or1k/include/types.h index f079c95..30a7675 100644 --- a/arch/or1k/include/types.h +++ b/arch/or1k/include/types.h @@ -67,6 +67,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/renesas/include/m16c/types.h b/arch/renesas/include/m16c/types.h index 61c88a2..b2aecc9 100644 --- a/arch/renesas/include/m16c/types.h +++ b/arch/renesas/include/m16c/types.h @@ -66,6 +66,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 2 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/renesas/include/rx65n/types.h b/arch/renesas/include/rx65n/types.h index f01ba75..eba12b3 100644 --- a/arch/renesas/include/rx65n/types.h +++ b/arch/renesas/include/rx65n/types.h @@ -64,6 +64,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/renesas/include/sh1/types.h b/arch/renesas/include/sh1/types.h index 8ea77c5..b25503f 100644 --- a/arch/renesas/include/sh1/types.h +++ b/arch/renesas/include/sh1/types.h @@ -64,6 +64,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/risc-v/include/types.h b/arch/risc-v/include/types.h index e2d0f1a..2a3b321 100644 --- a/arch/risc-v/include/types.h +++ b/arch/risc-v/include/types.h @@ -72,6 +72,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + #ifdef __LP64__ /* A size is 8 bytes */ diff --git a/arch/sim/include/types.h b/arch/sim/include/types.h index 099e90c..8fba09f 100644 --- a/arch/sim/include/types.h +++ b/arch/sim/include/types.h @@ -86,6 +86,12 @@ typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; #endif +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + #if defined(CONFIG_HOST_X86_64) && !defined(CONFIG_SIM_M32) /* 64-bit build on 64-bit machine: A size is 8 bytes */ diff --git a/arch/x86/include/i486/types.h b/arch/x86/include/i486/types.h index cc6f2cf..970cdda 100644 --- a/arch/x86/include/i486/types.h +++ b/arch/x86/include/i486/types.h @@ -65,6 +65,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/x86_64/include/intel64/types.h b/arch/x86_64/include/intel64/types.h index 6a52fe0..8880aa3 100644 --- a/arch/x86_64/include/intel64/types.h +++ b/arch/x86_64/include/intel64/types.h @@ -65,6 +65,12 @@ typedef unsigned long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + #if defined(__SIZE_TYPE__) /* If __SIZE_TYPE__ is defined we define ssize_t based on size_t. * We simply change "unsigned" to "signed" for this single definition diff --git a/arch/xtensa/include/types.h b/arch/xtensa/include/types.h index f6b1702..200b46e 100644 --- a/arch/xtensa/include/types.h +++ b/arch/xtensa/include/types.h @@ -64,6 +64,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/z16/include/types.h b/arch/z16/include/types.h index 424675d..1b9a51c 100644 --- a/arch/z16/include/types.h +++ b/arch/z16/include/types.h @@ -60,6 +60,12 @@ typedef unsigned int _uint32_t; typedef _int32_t _intmax_t; typedef _uint32_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 4 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/z80/include/ez80/types.h b/arch/z80/include/ez80/types.h index 1669cd3..734e353 100644 --- a/arch/z80/include/ez80/types.h +++ b/arch/z80/include/ez80/types.h @@ -84,6 +84,12 @@ typedef _int32_t _intmax_t; typedef _uint32_t _uintmax_t; #endif +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A pointer is 2 or 3 bytes, depending upon if the ez80 is in z80 * compatibility mode or not * diff --git a/arch/z80/include/z180/types.h b/arch/z80/include/z180/types.h index e895326..9f58ba2 100644 --- a/arch/z80/include/z180/types.h +++ b/arch/z80/include/z180/types.h @@ -72,6 +72,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 2 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/z80/include/z8/types.h b/arch/z80/include/z8/types.h index d55d2e5..787389b 100644 --- a/arch/z80/include/z8/types.h +++ b/arch/z80/include/z8/types.h @@ -76,6 +76,12 @@ typedef unsigned long _uint32_t; typedef _int32_t _intmax_t; typedef _uint32_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 2 bytes */ #if defined(__SIZE_TYPE__) diff --git a/arch/z80/include/z80/types.h b/arch/z80/include/z80/types.h index 9ba1310..f8efd7a 100644 --- a/arch/z80/include/z80/types.h +++ b/arch/z80/include/z80/types.h @@ -72,6 +72,12 @@ typedef unsigned long long _uint64_t; typedef _int64_t _intmax_t; typedef _uint64_t _uintmax_t; +#if defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ _wchar_t; +#else +typedef int _wchar_t; +#endif + /* A size is 2 bytes */ #if defined(__SIZE_TYPE__) diff --git a/include/sys/types.h b/include/sys/types.h index 4ae38c5..0c1f9b3 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -161,13 +161,13 @@ typedef int16_t key_t; typedef intptr_t ptrdiff_t; #if !defined(__cplusplus) -/* Wide, 16-bit character types. wchar_t is a built-in type in C++ and +/* Wide character types. wchar_t is a built-in type in C++ and * its declaration here may cause compilation errors on some compilers. * * REVISIT: wchar_t belongs in stddef.h */ -typedef uint16_t wchar_t; +typedef _wchar_t wchar_t; #endif /* wint_t