gcc 4.2.0 wchar fix

Kevin Day thekevinday at gmail.com
Thu May 24 21:48:17 UTC 2007


gcc now uses _GLIBCXX_USE_WCHAR_T to check for wchar support.

This caused all c++ programs to fail to compile due to missing information.

Here is a fix that defines this in bits/wchar.h if and only if uClibc
has its appropriate macro defined.

--- uClibc-0.9.29/libc/sysdeps/linux/common/bits/wchar.h.orig	2007-05-24
16:42:18 -0500
+++ uClibc-0.9.29/libc/sysdeps/linux/common/bits/wchar.h	2007-05-24
16:42:42 -0500
@@ -20,6 +20,10 @@
 #ifndef _BITS_WCHAR_H
 #define _BITS_WCHAR_H	1

+#ifdef __UCLIBC_HAS_WCHAR__
+#define _GLIBCXX_USE_WCHAR_T
+#endif
+
 #define __WCHAR_MIN	(-2147483647 - 1)
 #define __WCHAR_MAX	(2147483647)

--- uClibc-0.9.29/libc/sysdeps/linux/i386/bits/wchar.h.orig	2007-05-24
16:42:25 -0500
+++ uClibc-0.9.29/libc/sysdeps/linux/i386/bits/wchar.h	2007-05-24 16:42:48 -0500
@@ -20,6 +20,10 @@
 #ifndef _BITS_WCHAR_H
 #define _BITS_WCHAR_H	1

+#ifdef __UCLIBC_HAS_WCHAR__
+#define _GLIBCXX_USE_WCHAR_T
+#endif
+
 #define __WCHAR_MIN	(-2147483647l - 1l)
 #define __WCHAR_MAX	(2147483647l)

-- 
Kevin Day



More information about the uClibc mailing list