diff --git a/src/arch/riscv64/include/bits/types.h b/src/arch/riscv64/include/bits/types.h index b5309a02d49075e49152d7ee4e2841e17da5264a..8f04e40a0692117b1fbaa699ca0f41339e82f35c 100644 --- a/src/arch/riscv64/include/bits/types.h +++ b/src/arch/riscv64/include/bits/types.h @@ -25,6 +25,18 @@ typedef signed long int loff_t; typedef signed int bool_t; +#ifndef __cplusplus typedef int wchar_t; +#endif // !__cplusplus typedef unsigned wint_t; typedef unsigned long wctype_t; + +#if !defined(__DEFINED_locale_t) +typedef struct __locale_struct * locale_t; +#define __DEFINED_locale_t +#endif + +#if !defined(__DEFINED_max_align_t) +typedef struct { long long __ll; long double __ld; } max_align_t; +#define __DEFINED_max_align_t +#endif diff --git a/src/arch/x86/include/bits/types.h b/src/arch/x86/include/bits/types.h index 1aadc7fb203cd61106d01b4bb6282b2589f34c9c..ad51c75665fe1b662fe4f5b7e62d71aa4a2eec57 100644 --- a/src/arch/x86/include/bits/types.h +++ b/src/arch/x86/include/bits/types.h @@ -13,18 +13,36 @@ typedef unsigned long long u64_t; typedef signed long long intmax_t; typedef unsigned long long uintmax_t; -typedef signed int ptrdiff_t; -typedef signed int intptr_t; -typedef unsigned int uintptr_t; +typedef signed long int ptrdiff_t; +typedef signed long int intptr_t; +typedef unsigned long int uintptr_t; -typedef unsigned int size_t; -typedef signed int ssize_t; +typedef unsigned long int size_t; +typedef signed long int ssize_t; typedef signed int off_t; typedef signed long long loff_t; typedef signed int bool_t; +#ifndef __cplusplus typedef unsigned short wchar_t; +#endif // !__cplusplus typedef unsigned wint_t; typedef unsigned long wctype_t; + +#if !defined(__DEFINED_locale_t) +typedef struct __locale_struct * locale_t; +#define __DEFINED_locale_t +#endif + +#if !defined(__DEFINED_max_align_t) +#if !defined(__cplusplus) +typedef struct { _Alignas(8) long long __ll; long double __ld; } max_align_t; +#elif defined(__GNUC__) +typedef struct { __attribute__((__aligned__(8))) long long __ll; long double __ld; } max_align_t; +#else +typedef struct { alignas(8) long long __ll; long double __ld; } max_align_t; +#endif +#define __DEFINED_max_align_t +#endif diff --git a/src/internal/locale_impl.h b/src/internal/locale_impl.h index 1a3dabf6e35719becb7bbc592616befc4dd4f7a3..52461cae29b123ead6bebfe7ec4b221ac630631e 100644 --- a/src/internal/locale_impl.h +++ b/src/internal/locale_impl.h @@ -15,8 +15,6 @@ struct __locale_map { const struct __locale_map *next; }; -typedef struct __locale_struct * locale_t; - extern hidden_sym volatile int __locale_lock[1]; extern hidden_sym const struct __locale_map __c_dot_utf8;