]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[libc] Add missing wchar.h header
authorMichael Brown <mcb30@ipxe.org>
Thu, 19 Jul 2012 16:19:26 +0000 (17:19 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 19 Jul 2012 16:19:51 +0000 (17:19 +0100)
Commit 58ed3b1 ("[libc] Add support for "%lc" and "%ls" format
specifiers") was missing a file.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/wchar.h [new file with mode: 0644]

diff --git a/src/include/wchar.h b/src/include/wchar.h
new file mode 100644 (file)
index 0000000..84312c7
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef WCHAR_H
+#define WCHAR_H
+
+FILE_LICENCE ( GPL2_ONLY );
+
+#include <stddef.h>
+
+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 */