From 635752389226ad005f52524a933acf864c1a1f8d Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 1 Nov 2021 12:40:51 +0800 Subject: [PATCH] arch: Add _wchar_t typedef like other basic types Signed-off-by: Xiang Xiao --- 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 32052c8896..a14c450243 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 7bd220e433..6dedd3df05 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 8f7fbbf9c3..ec18719c77 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 985c885efd..85b08080ae 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 826a76d49d..da9ec26570 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 a14997352d..de4870bbed 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 ed873e0eca..a6d27b03ac 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 f079c956b0..30a76756ed 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 61c88a2c34..b2aecc96ba 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 f01ba75871..eba12b3ff9 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 8ea77c5a68..b25503fe8c 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 e2d0f1a207..2a3b32148b 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 099e90c3c4..8fba09f29e 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 cc6f2cf6fc..970cdda70d 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 6a52fe0da9..8880aa37e0 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 f6b1702ee3..200b46e043 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 424675dbb5..1b9a51c306 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 1669cd3823..734e35351f 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 e895326bf3..9f58ba29d0 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 d55d2e53d9..787389b354 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 9ba13103c4..f8efd7ae88 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 4ae38c5c26..0c1f9b3ebc 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