includes: Provide `wchar.h` with `wchar_t` and `wint_t`

Change-Id: Iacb0e4eaf3f0b6bf843f3bfda5bdfde0f7a98808
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55590
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Nico Huber 2021-06-16 17:46:17 +00:00 committed by Werner Zeh
parent 0a31d5e7f5
commit 2eae410c54
3 changed files with 22 additions and 6 deletions

View File

@ -154,9 +154,9 @@ typedef unsigned long mmask_t;
//// #define va_list int // FIXME //// #define va_list int // FIXME
#define _XOPEN_SOURCE_EXTENDED 1 // XXX #define _XOPEN_SOURCE_EXTENDED 1 // XXX
//// #ifdef _XOPEN_SOURCE_EXTENDED #ifdef _XOPEN_SOURCE_EXTENDED
//// #include <stddef.h> /* we want wchar_t */ #include <stddef.h> /* we want wchar_t */
//// #endif /* _XOPEN_SOURCE_EXTENDED */ #endif /* _XOPEN_SOURCE_EXTENDED */
/* XSI and SVr4 specify that curses implements 'bool'. However, C++ may also /* XSI and SVr4 specify that curses implements 'bool'. However, C++ may also
* implement it. If so, we must use the C++ compiler's type to avoid conflict * implement it. If so, we must use the C++ compiler's type to avoid conflict
@ -350,9 +350,7 @@ typedef chtype attr_t; /* ...must be at least as wide as chtype */
#endif #endif
#if 1 #if 1
//// #include <wchar.h> /* ...to get mbstate_t, etc. */ #include <wchar.h> /* ...to get mbstate_t, etc. */
typedef unsigned long wchar_t; // XXX
typedef unsigned long wint_t; // XXX
#endif #endif
#if 0 #if 0

View File

@ -3,6 +3,13 @@
#include <arch/types.h> #include <arch/types.h>
#ifndef __WCHAR_TYPE__
#define __WCHAR_TYPE__ int
#endif
#ifndef __cplusplus
typedef __WCHAR_TYPE__ wchar_t;
#endif
#ifndef __SIZE_TYPE__ #ifndef __SIZE_TYPE__
#define __SIZE_TYPE__ unsigned long #define __SIZE_TYPE__ unsigned long
#endif #endif

View File

@ -0,0 +1,11 @@
#ifndef _WCHAR_H
#define _WCHAR_H
#include <stddef.h>
#ifndef __WINT_TYPE__
# define __WINT_TYPE__ unsigned int
#endif
typedef __WINT_TYPE__ wint_t;
#endif