Browse Source

[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>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
23b70323c7
1 changed files with 27 additions and 0 deletions
  1. 27
    0
      src/include/wchar.h

+ 27
- 0
src/include/wchar.h View File

@@ -0,0 +1,27 @@
1
+#ifndef WCHAR_H
2
+#define WCHAR_H
3
+
4
+FILE_LICENCE ( GPL2_ONLY );
5
+
6
+#include <stddef.h>
7
+
8
+typedef void mbstate_t;
9
+
10
+/**
11
+ * Convert wide character to multibyte sequence
12
+ *
13
+ * @v buf		Buffer
14
+ * @v wc		Wide character
15
+ * @v ps		Shift state
16
+ * @ret len		Number of characters written
17
+ *
18
+ * This is a stub implementation, sufficient to handle basic ASCII
19
+ * characters.
20
+ */
21
+static inline __attribute__ (( always_inline ))
22
+size_t wcrtomb ( char *buf, wchar_t wc, mbstate_t *ps __unused ) {
23
+	*buf = wc;
24
+	return 1;
25
+}
26
+
27
+#endif /* WCHAR_H */

Loading…
Cancel
Save