[git commit nptl] add a wchar.h stub

Mike Frysinger vapier at gentoo.org
Wed Aug 19 11:29:41 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=44896253aab05ab2d41143337761859250f0cea4
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/nptl

The basic C standard requires a few wchar types, so provide those even when
wchar support is disabled.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 Makefile.in          |    5 +++++
 include/wchar-stub.h |   14 ++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 include/wchar-stub.h

diff --git a/Makefile.in b/Makefile.in
index 25de0e3..ec1c384 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -292,6 +292,11 @@ install_headers: headers $(top_builddir)extra/scripts/unifdef
 	echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
 		$(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
 	cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -r $(HEADERS_RM-)
+ifeq ($(UCLIBC_HAS_WCHAR),)
+	cd $(PREFIX)$(DEVEL_PREFIX)include && mv -f wchar-stub.h wchar.h
+else
+	cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -f wchar-stub.h
+endif
 
 # Installs development library links.
 install_dev: install_headers all
diff --git a/include/wchar-stub.h b/include/wchar-stub.h
new file mode 100644
index 0000000..0b0aa29
--- /dev/null
+++ b/include/wchar-stub.h
@@ -0,0 +1,14 @@
+/* This wchar.h is used if wchar support is disabled in uClibc.
+ * We still want to provide a few basic definitions as the basic
+ * C standard requires them.  And it makes our lives easier with
+ * no additional overhead.
+ */
+
+#ifndef _WCHAR_H
+#define _WCHAR_H
+
+#define MB_CUR_MAX 1
+typedef unsigned int wint_t;
+#define WEOF (0xffffffffu)
+
+#endif
-- 
1.6.3.3



More information about the uClibc-cvs mailing list