From: Michael Brown Date: Thu, 19 Jul 2012 16:19:26 +0000 (+0100) Subject: [libc] Add missing wchar.h header X-Git-Tag: v1.20.1~1697 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23b70323c7d91b941344df6a27ddd035d0fea934;p=thirdparty%2Fipxe.git [libc] Add missing wchar.h header Commit 58ed3b1 ("[libc] Add support for "%lc" and "%ls" format specifiers") was missing a file. Signed-off-by: Michael Brown --- diff --git a/src/include/wchar.h b/src/include/wchar.h new file mode 100644 index 000000000..84312c705 --- /dev/null +++ b/src/include/wchar.h @@ -0,0 +1,27 @@ +#ifndef WCHAR_H +#define WCHAR_H + +FILE_LICENCE ( GPL2_ONLY ); + +#include + +typedef void mbstate_t; + +/** + * Convert wide character to multibyte sequence + * + * @v buf Buffer + * @v wc Wide character + * @v ps Shift state + * @ret len Number of characters written + * + * This is a stub implementation, sufficient to handle basic ASCII + * characters. + */ +static inline __attribute__ (( always_inline )) +size_t wcrtomb ( char *buf, wchar_t wc, mbstate_t *ps __unused ) { + *buf = wc; + return 1; +} + +#endif /* WCHAR_H */