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