summaryrefslogtreecommitdiffstats
path: root/src/include/wchar.h
diff options
context:
space:
mode:
authorMichael Brown2012-07-19 18:19:26 +0200
committerMichael Brown2012-07-19 18:19:51 +0200
commit23b70323c7d91b941344df6a27ddd035d0fea934 (patch)
tree3686fa5b6c75b85754a76f91988a14908b6157a6 /src/include/wchar.h
parent[skel] Add missing iounmap() (diff)
downloadipxe-23b70323c7d91b941344df6a27ddd035d0fea934.tar.gz
ipxe-23b70323c7d91b941344df6a27ddd035d0fea934.tar.xz
ipxe-23b70323c7d91b941344df6a27ddd035d0fea934.zip
[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 <mcb30@ipxe.org>
Diffstat (limited to 'src/include/wchar.h')
-rw-r--r--src/include/wchar.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/include/wchar.h b/src/include/wchar.h
new file mode 100644
index 00000000..84312c70
--- /dev/null
+++ b/src/include/wchar.h
@@ -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 */