summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-uclibc-locale-ctype_touplow_t.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-uclibc-locale-ctype_touplow_t.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-uclibc-locale-ctype_touplow_t.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-uclibc-locale-ctype_touplow_t.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-uclibc-locale-ctype_touplow_t.patch
new file mode 100644
index 0000000000..8b71e313d9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-uclibc-locale-ctype_touplow_t.patch
@@ -0,0 +1,70 @@
1Index: gcc-4.6.0/libstdc++-v3/config/locale/generic/c_locale.h
2===================================================================
3--- gcc-4.6.0.orig/libstdc++-v3/config/locale/generic/c_locale.h
4+++ gcc-4.6.0/libstdc++-v3/config/locale/generic/c_locale.h
5@@ -41,13 +41,22 @@
6
7 #include <clocale>
8
9+#ifdef __UCLIBC__
10+#include <features.h>
11+#include <ctype.h>
12+#endif
13+
14 #define _GLIBCXX_NUM_CATEGORIES 0
15
16 namespace std _GLIBCXX_VISIBILITY(default)
17 {
18 _GLIBCXX_BEGIN_NAMESPACE_VERSION
19
20+#ifdef __UCLIBC__
21+ typedef __ctype_touplow_t* __c_locale;
22+#else
23 typedef int* __c_locale;
24+#endif
25
26 // Convert numeric value of type double and long double to string and
27 // return length of string. If vsnprintf is available use it, otherwise
28Index: gcc-4.6.0/libstdc++-v3/config/os/gnu-linux/ctype_base.h
29===================================================================
30--- gcc-4.6.0.orig/libstdc++-v3/config/os/gnu-linux/ctype_base.h
31+++ gcc-4.6.0/libstdc++-v3/config/os/gnu-linux/ctype_base.h
32@@ -34,6 +34,11 @@
33
34 // Information as gleaned from /usr/include/ctype.h
35
36+#ifdef __UCLIBC__
37+#include <features.h>
38+#include <ctype.h>
39+#endif
40+
41 namespace std _GLIBCXX_VISIBILITY(default)
42 {
43 _GLIBCXX_BEGIN_NAMESPACE_VERSION
44@@ -42,7 +47,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
45 struct ctype_base
46 {
47 // Non-standard typedefs.
48+#ifdef __UCLIBC__
49+ typedef const __ctype_touplow_t* __to_type;
50+#else
51 typedef const int* __to_type;
52+#endif
53
54 // NB: Offsets into ctype<char>::_M_table force a particular size
55 // on the mask type. Because of this, we don't use an enum.
56Index: gcc-4.6.0/libstdc++-v3/config/locale/generic/c_locale.cc
57===================================================================
58--- gcc-4.6.0.orig/libstdc++-v3/config/locale/generic/c_locale.cc
59+++ gcc-4.6.0/libstdc++-v3/config/locale/generic/c_locale.cc
60@@ -264,5 +264,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
61 #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
62 #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
63 extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
64+#ifdef __UCLIBC__
65+// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
66+_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
67+#else
68 _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
69+#endif
70 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT