Vampirise patches for gcc-4.3.{0,1} from gentoo. Absolutely untested...
/trunk/patches/gcc/4.3.0/275-gcc-x86-emit-cld.patch | 156 156 0 0 +
/trunk/patches/gcc/4.3.0/450-gcc4-noteGNUstack.patch | 198 198 0 0 +
/trunk/patches/gcc/4.3.0/550-gcc43-pr25343.patch | 21 21 0 0 +
/trunk/patches/gcc/4.3.0/375-gcc43-pr35440.patch | 59 59 0 0 +
/trunk/patches/gcc/4.3.0/125-gcc-trampolinewarn.patch | 35 35 0 0 +
/trunk/patches/gcc/4.3.0/475-gcc43-pr35705.patch | 21 21 0 0 +
/trunk/patches/gcc/4.3.0/700-204-uclibc-locale-wchar_fix.patch | 51 51 0 0 +
/trunk/patches/gcc/4.3.0/775-303-c99-complex-ugly-hack.patch | 14 14 0 0 +
/trunk/patches/gcc/4.3.0/575-sh-pr24836.patch | 28 28 0 0 +
/trunk/patches/gcc/4.3.0/675-203-uclibc-locale-no__x.patch | 224 224 0 0 +
/trunk/patches/gcc/4.3.0/400-gcc43-pr24170.patch | 61 61 0 0 +
/trunk/patches/gcc/4.3.0/100-gcc-4.1-alpha-mieee-default.patch | 34 34 0 0 +
/trunk/patches/gcc/4.3.0/825-305-libmudflap-susv3-legacy.patch | 49 49 0 0 +
/trunk/patches/gcc/4.3.0/175-gcc-4.1-cross-compile.patch | 44 44 0 0 +
/trunk/patches/gcc/4.3.0/850-306-libstdc++-namespace.patch | 38 38 0 0 +
/trunk/patches/gcc/4.3.0/200-gcc-netbsd-symbolic.patch | 14 14 0 0 +
/trunk/patches/gcc/4.3.0/750-301-missing-execinfo_h.patch | 13 13 0 0 +
/trunk/patches/gcc/4.3.0/225-gcc-sparc64-bsd.patch | 30 30 0 0 +
/trunk/patches/gcc/4.3.0/350-300-libstdc++-pic.patch | 56 56 0 0 +
/trunk/patches/gcc/4.3.0/500-gcc43-pr34571.patch | 35 35 0 0 +
/trunk/patches/gcc/4.3.0/300-gcc-3.4-libiberty-pic.patch | 12 12 0 0 +
/trunk/patches/gcc/4.3.0/625-103-uclibc-conf-noupstream.patch | 13 13 0 0 +
/trunk/patches/gcc/4.3.0/425-gcc4-ia64-noteGNUstack.patch | 96 96 0 0 +
/trunk/patches/gcc/4.3.0/325-gcc4-superh-default-multilib.patch | 25 25 0 0 +
/trunk/patches/gcc/4.3.0/725-205-uclibc-locale-update.patch | 355 355 0 0 ++
/trunk/patches/gcc/4.3.0/800-304-index_macro.patch | 27 27 0 0 +
/trunk/patches/gcc/4.3.0/600-gcc-ca-translation-typo.patch | 19 19 0 0 +
/trunk/patches/gcc/4.3.0/650-200-uclibc-locale.patch | 2794 2794 0 0 +++++++++++++++
/trunk/patches/gcc/4.3.0/525-gcc43-pr35982.patch | 23 23 0 0 +
/trunk/patches/gcc/4.3.0/150-gcc43-java-nomulti.patch | 47 47 0 0 +
/trunk/patches/gcc/4.3.0/250-904-flatten-switch-stmt-00.patch | 76 76 0 0 +
/trunk/patches/gcc/4.3.1/100-gcc-4.1-alpha-mieee-default.patch | 34 34 0 0 +
/trunk/patches/gcc/4.3.1/500-103-uclibc-conf-noupstream.patch | 13 13 0 0 +
/trunk/patches/gcc/4.3.1/175-gcc-4.1-cross-compile.patch | 44 44 0 0 +
/trunk/patches/gcc/4.3.1/400-gcc4-noteGNUstack.patch | 198 198 0 0 +
/trunk/patches/gcc/4.3.1/600-205-uclibc-locale-update.patch | 355 355 0 0 ++
/trunk/patches/gcc/4.3.1/725-306-libstdc++-namespace.patch | 38 38 0 0 +
/trunk/patches/gcc/4.3.1/350-gcc43-pr24170.patch | 61 61 0 0 +
/trunk/patches/gcc/4.3.1/300-gcc4-superh-default-multilib.patch | 25 25 0 0 +
/trunk/patches/gcc/4.3.1/575-204-uclibc-locale-wchar_fix.patch | 51 51 0 0 +
/trunk/patches/gcc/4.3.1/200-gcc-netbsd-symbolic.patch | 14 14 0 0 +
/trunk/patches/gcc/4.3.1/225-gcc-sparc64-bsd.patch | 30 30 0 0 +
/trunk/patches/gcc/4.3.1/450-gcc43-pr25343.patch | 21 21 0 0 +
/trunk/patches/gcc/4.3.1/625-301-missing-execinfo_h.patch | 13 13 0 0 +
/trunk/patches/gcc/4.3.1/325-300-libstdc++-pic.patch | 56 56 0 0 +
/trunk/patches/gcc/4.3.1/425-gcc43-pr34571.patch | 35 35 0 0 +
/trunk/patches/gcc/4.3.1/375-gcc4-ia64-noteGNUstack.patch | 96 96 0 0 +
/trunk/patches/gcc/4.3.1/125-gcc-trampolinewarn.patch | 35 35 0 0 +
/trunk/patches/gcc/4.3.1/275-gcc-3.4-libiberty-pic.patch | 12 12 0 0 +
/trunk/patches/gcc/4.3.1/650-303-c99-complex-ugly-hack.patch | 14 14 0 0 +
/trunk/patches/gcc/4.3.1/525-200-uclibc-locale.patch | 2794 2794 0 0 +++++++++++++++
/trunk/patches/gcc/4.3.1/550-203-uclibc-locale-no__x.patch | 224 224 0 0 +
/trunk/patches/gcc/4.3.1/150-gcc43-java-nomulti.patch | 47 47 0 0 +
/trunk/patches/gcc/4.3.1/700-305-libmudflap-susv3-legacy.patch | 49 49 0 0 +
/trunk/patches/gcc/4.3.1/675-304-index_macro.patch | 27 27 0 0 +
/trunk/patches/gcc/4.3.1/250-904-flatten-switch-stmt-00.patch | 76 76 0 0 +
/trunk/patches/gcc/4.3.1/475-sh-pr24836.patch | 28 28 0 0 +
57 files changed, 9058 insertions(+)
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/gcc/4.3.0/100-gcc-4.1-alpha-mieee-default.patch Tue Jun 10 22:10:40 2008 +0000
1.3 @@ -0,0 +1,34 @@
1.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
1.5 +Set the default behavior on alpha to use -mieee since the large majority of
1.6 +time we want this (bad/weird things can happen with packages built without
1.7 +-mieee).
1.8 +
1.9 +To satisfy those people who may not want -mieee forced on them all the time,
1.10 +we also provide -mno-ieee.
1.11 +
1.12 +Patch by Mike Frysinger <vapier@gentoo.org>
1.13 +
1.14 +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.h gcc-4.3.0/gcc/config/alpha/alpha.h
1.15 +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.h 2007-12-06 14:25:37.000000000 +0100
1.16 ++++ gcc-4.3.0/gcc/config/alpha/alpha.h 2008-06-10 14:44:06.000000000 +0200
1.17 +@@ -95,6 +95,8 @@
1.18 + while (0)
1.19 + #endif
1.20 +
1.21 ++#define CPP_SPEC "%{!no-ieee:-mieee}"
1.22 ++
1.23 + #define WORD_SWITCH_TAKES_ARG(STR) \
1.24 + (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
1.25 +
1.26 +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.opt gcc-4.3.0/gcc/config/alpha/alpha.opt
1.27 +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200
1.28 ++++ gcc-4.3.0/gcc/config/alpha/alpha.opt 2008-06-10 14:44:06.000000000 +0200
1.29 +@@ -39,7 +39,7 @@
1.30 + Request IEEE-conformant math library routines (OSF/1)
1.31 +
1.32 + mieee
1.33 +-Target Report RejectNegative Mask(IEEE)
1.34 ++Target Report Mask(IEEE)
1.35 + Emit IEEE-conformant code, without inexact exceptions
1.36 +
1.37 + mieee-with-inexact
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/patches/gcc/4.3.0/125-gcc-trampolinewarn.patch Tue Jun 10 22:10:40 2008 +0000
2.3 @@ -0,0 +1,35 @@
2.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-trampolinewarn.patch
2.5 + This trivial patch causes gcc to emit a warning whenever
2.6 + it generates a trampoline. These are otherwise hard to
2.7 + locate. It is rigged to default ON - to have it default
2.8 + to OFF remove the text 'Init(1)' from the common.opt
2.9 + patch, leaving just 'Common Var(warn_trampolines)'.
2.10 + Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
2.11 +
2.12 +diff -durN gcc-4.3.0.orig/gcc/builtins.c gcc-4.3.0/gcc/builtins.c
2.13 +--- gcc-4.3.0.orig/gcc/builtins.c 2008-02-20 18:27:21.000000000 +0100
2.14 ++++ gcc-4.3.0/gcc/builtins.c 2008-06-10 14:44:10.000000000 +0200
2.15 +@@ -5659,6 +5659,9 @@
2.16 + trampolines_created = 1;
2.17 + INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
2.18 +
2.19 ++ if (warn_trampolines)
2.20 ++ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
2.21 ++
2.22 + return const0_rtx;
2.23 + }
2.24 +
2.25 +diff -durN gcc-4.3.0.orig/gcc/common.opt gcc-4.3.0/gcc/common.opt
2.26 +--- gcc-4.3.0.orig/gcc/common.opt 2008-01-22 15:11:44.000000000 +0100
2.27 ++++ gcc-4.3.0/gcc/common.opt 2008-06-10 14:44:10.000000000 +0200
2.28 +@@ -182,6 +182,10 @@
2.29 + Common Var(warn_system_headers) Warning
2.30 + Do not suppress warnings from system headers
2.31 +
2.32 ++Wtrampolines
2.33 ++Common Var(warn_trampolines) Init(1)
2.34 ++Warn whenever a trampoline is generated
2.35 ++
2.36 + Wuninitialized
2.37 + Common Var(warn_uninitialized) Warning
2.38 + Warn about uninitialized automatic variables
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/patches/gcc/4.3.0/150-gcc43-java-nomulti.patch Tue Jun 10 22:10:40 2008 +0000
3.3 @@ -0,0 +1,47 @@
3.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/03_all_gcc43-java-nomulti.patch
3.5 +diff -durN gcc-4.3.0.orig/libjava/configure gcc-4.3.0/libjava/configure
3.6 +--- gcc-4.3.0.orig/libjava/configure 2008-03-05 19:44:25.000000000 +0100
3.7 ++++ gcc-4.3.0/libjava/configure 2008-06-10 14:44:13.000000000 +0200
3.8 +@@ -1018,6 +1018,8 @@
3.9 + --enable-gconf-peer compile GConf native peers for util.preferences
3.10 + --enable-java-maintainer-mode
3.11 + allow rebuilding of .class and .h files
3.12 ++ --enable-libjava-multilib
3.13 ++ build libjava as multilib
3.14 + --disable-dependency-tracking speeds up one-time build
3.15 + --enable-dependency-tracking do not reject slow dependency extractors
3.16 + --enable-maintainer-mode enable make rules and dependencies not useful
3.17 +@@ -1850,6 +1852,16 @@
3.18 + fi
3.19 +
3.20 +
3.21 ++# Check whether --enable-libjava-multilib was given.
3.22 ++if test "${enable_libjava_multilib+set}" = set; then
3.23 ++ enableval=$enable_libjava_multilib;
3.24 ++fi
3.25 ++
3.26 ++if test "$enable_libjava_multilib" = no; then
3.27 ++ multilib=no
3.28 ++ ac_configure_args="$ac_configure_args --disable-multilib"
3.29 ++fi
3.30 ++
3.31 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
3.32 +
3.33 +
3.34 +diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
3.35 +--- gcc-4.3.0.orig/libjava/configure.ac 2007-12-22 16:48:46.000000000 +0100
3.36 ++++ gcc-4.3.0/libjava/configure.ac 2008-06-10 14:44:13.000000000 +0200
3.37 +@@ -82,6 +82,13 @@
3.38 + [allow rebuilding of .class and .h files]))
3.39 + AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
3.40 +
3.41 ++AC_ARG_ENABLE(libjava-multilib,
3.42 ++ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
3.43 ++if test "$enable_libjava_multilib" = no; then
3.44 ++ multilib=no
3.45 ++ ac_configure_args="$ac_configure_args --disable-multilib"
3.46 ++fi
3.47 ++
3.48 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
3.49 + GCC_NO_EXECUTABLES
3.50 +
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/patches/gcc/4.3.0/175-gcc-4.1-cross-compile.patch Tue Jun 10 22:10:40 2008 +0000
4.3 @@ -0,0 +1,44 @@
4.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/08_all_gcc-4.1-cross-compile.patch
4.5 +Some notes on the 'bootstrap with or without libc headers' debate:
4.6 +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
4.7 +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
4.8 +
4.9 +diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure
4.10 +--- gcc-4.3.0.orig/gcc/configure 2008-03-05 00:39:11.000000000 +0100
4.11 ++++ gcc-4.3.0/gcc/configure 2008-06-10 14:44:17.000000000 +0200
4.12 +@@ -13274,7 +13274,7 @@
4.13 + | powerpc*-*-*,powerpc64*-*-*)
4.14 + CROSS="$CROSS -DNATIVE_CROSS" ;;
4.15 + esac
4.16 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
4.17 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
4.18 + SYSTEM_HEADER_DIR=$build_system_header_dir
4.19 + fi
4.20 +
4.21 +diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac
4.22 +--- gcc-4.3.0.orig/gcc/configure.ac 2008-03-05 00:39:11.000000000 +0100
4.23 ++++ gcc-4.3.0/gcc/configure.ac 2008-06-10 14:44:17.000000000 +0200
4.24 +@@ -1745,7 +1745,7 @@
4.25 + | powerpc*-*-*,powerpc64*-*-*)
4.26 + CROSS="$CROSS -DNATIVE_CROSS" ;;
4.27 + esac
4.28 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
4.29 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
4.30 + SYSTEM_HEADER_DIR=$build_system_header_dir
4.31 + fi
4.32 +
4.33 +diff -durN gcc-4.3.0.orig/gcc/unwind-dw2.c gcc-4.3.0/gcc/unwind-dw2.c
4.34 +--- gcc-4.3.0.orig/gcc/unwind-dw2.c 2007-07-25 20:14:57.000000000 +0200
4.35 ++++ gcc-4.3.0/gcc/unwind-dw2.c 2008-06-10 14:44:17.000000000 +0200
4.36 +@@ -334,9 +334,11 @@
4.37 + }
4.38 + #endif
4.39 +
4.40 ++#ifndef inhibit_libc
4.41 + #ifdef MD_UNWIND_SUPPORT
4.42 + #include MD_UNWIND_SUPPORT
4.43 + #endif
4.44 ++#endif
4.45 +
4.46 + /* Extract any interesting information from the CIE for the translation
4.47 + unit F belongs to. Return a pointer to the byte after the augmentation,
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/patches/gcc/4.3.0/200-gcc-netbsd-symbolic.patch Tue Jun 10 22:10:40 2008 +0000
5.3 @@ -0,0 +1,14 @@
5.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/11_all_gcc-netbsd-symbolic.patch
5.5 +http://bugs.gentoo.org/122698
5.6 +
5.7 +diff -durN gcc-4.3.0.orig/gcc/config/netbsd-elf.h gcc-4.3.0/gcc/config/netbsd-elf.h
5.8 +--- gcc-4.3.0.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200
5.9 ++++ gcc-4.3.0/gcc/config/netbsd-elf.h 2008-06-10 14:44:21.000000000 +0200
5.10 +@@ -82,6 +82,7 @@
5.11 + #define NETBSD_LINK_SPEC_ELF \
5.12 + "%{assert*} %{R*} %{rpath*} \
5.13 + %{shared:-shared} \
5.14 ++ %{symbolic:-Bsymbolic} \
5.15 + %{!shared: \
5.16 + -dc -dp \
5.17 + %{!nostdlib: \
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/patches/gcc/4.3.0/225-gcc-sparc64-bsd.patch Tue Jun 10 22:10:40 2008 +0000
6.3 @@ -0,0 +1,30 @@
6.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/14_all_gcc-sparc64-bsd.patch
6.5 +diff -durN gcc-4.3.0.orig/gcc/config/sparc/freebsd.h gcc-4.3.0/gcc/config/sparc/freebsd.h
6.6 +--- gcc-4.3.0.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200
6.7 ++++ gcc-4.3.0/gcc/config/sparc/freebsd.h 2008-06-10 14:44:26.000000000 +0200
6.8 +@@ -25,9 +25,22 @@
6.9 + /* FreeBSD needs the platform name (sparc64) defined.
6.10 + Emacs needs to know if the arch is 64 or 32-bits. */
6.11 +
6.12 +-#undef CPP_CPU64_DEFAULT_SPEC
6.13 +-#define CPP_CPU64_DEFAULT_SPEC \
6.14 +- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
6.15 ++#undef FBSD_TARGET_CPU_CPP_BUILTINS
6.16 ++#define FBSD_TARGET_CPU_CPP_BUILTINS() \
6.17 ++ do \
6.18 ++ { \
6.19 ++ if (TARGET_ARCH64) \
6.20 ++ { \
6.21 ++ builtin_define ("__sparc64__"); \
6.22 ++ builtin_define ("__sparc_v9__"); \
6.23 ++ builtin_define ("__sparcv9"); \
6.24 ++ } \
6.25 ++ else \
6.26 ++ builtin_define ("__sparc"); \
6.27 ++ builtin_define ("__sparc__"); \
6.28 ++ } \
6.29 ++ while (0)
6.30 ++
6.31 +
6.32 + #define LINK_SPEC "%(link_arch) \
6.33 + %{!mno-relax:%{!r:-relax}} \
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/patches/gcc/4.3.0/250-904-flatten-switch-stmt-00.patch Tue Jun 10 22:10:40 2008 +0000
7.3 @@ -0,0 +1,76 @@
7.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/18_all_904-flatten-switch-stmt-00.patch
7.5 +http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
7.6 +
7.7 +Hi,
7.8 +
7.9 +The attached patch makes sure that we create smaller object code for
7.10 +simple switch statements. We just make sure to flatten the switch
7.11 +statement into an if-else chain, basically.
7.12 +
7.13 +This fixes a size-regression as compared to gcc-3.4, as can be seen
7.14 +below.
7.15 +
7.16 +2007-04-15 Bernhard Fischer <..>
7.17 +
7.18 + * stmt.c (expand_case): Do not create a complex binary tree when
7.19 + optimizing for size but rather use the simple ordered list.
7.20 + (emit_case_nodes): do not emit jumps to the default_label when
7.21 + optimizing for size.
7.22 +
7.23 +Not regtested so far.
7.24 +Comments?
7.25 +
7.26 +Attached is the test switch.c mentioned below.
7.27 +
7.28 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
7.29 +gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
7.30 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
7.31 +gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
7.32 +
7.33 +$ size switch-*.o
7.34 + text data bss dec hex filename
7.35 + 169 0 0 169 a9 switch-2.95.o
7.36 + 115 0 0 115 73 switch-3.3.o
7.37 + 103 0 0 103 67 switch-3.4.o
7.38 + 124 0 0 124 7c switch-4.0.o
7.39 + 124 0 0 124 7c switch-4.1.o
7.40 + 124 0 0 124 7c switch-4.2.orig-HEAD.o
7.41 + 95 0 0 95 5f switch-4.3-HEAD.o
7.42 + 124 0 0 124 7c switch-4.3.orig-HEAD.o
7.43 + 166 0 0 166 a6 switch-CHAIN-2.95.o
7.44 + 111 0 0 111 6f switch-CHAIN-3.3.o
7.45 + 95 0 0 95 5f switch-CHAIN-3.4.o
7.46 + 95 0 0 95 5f switch-CHAIN-4.0.o
7.47 + 95 0 0 95 5f switch-CHAIN-4.1.o
7.48 + 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
7.49 + 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
7.50 + 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
7.51 +
7.52 +
7.53 +Content-Type: text/x-diff; charset=us-ascii
7.54 +Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
7.55 +
7.56 +diff -durN gcc-4.3.0.orig/gcc/stmt.c gcc-4.3.0/gcc/stmt.c
7.57 +--- gcc-4.3.0.orig/gcc/stmt.c 2007-12-04 22:55:32.000000000 +0100
7.58 ++++ gcc-4.3.0/gcc/stmt.c 2008-06-10 14:44:33.000000000 +0200
7.59 +@@ -2508,7 +2508,11 @@
7.60 + use_cost_table
7.61 + = (TREE_CODE (orig_type) != ENUMERAL_TYPE
7.62 + && estimate_case_costs (case_list));
7.63 +- balance_case_nodes (&case_list, NULL);
7.64 ++ /* When optimizing for size, we want a straight list to avoid
7.65 ++ jumps as much as possible. This basically creates an if-else
7.66 ++ chain. */
7.67 ++ if (!optimize_size)
7.68 ++ balance_case_nodes (&case_list, NULL);
7.69 + emit_case_nodes (index, case_list, default_label, index_type);
7.70 + emit_jump (default_label);
7.71 + }
7.72 +@@ -3066,6 +3070,7 @@
7.73 + {
7.74 + if (!node_has_low_bound (node, index_type))
7.75 + {
7.76 ++ if (!optimize_size) /* don't jl to the .default_label. */
7.77 + emit_cmp_and_jump_insns (index,
7.78 + convert_modes
7.79 + (mode, imode,
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/patches/gcc/4.3.0/275-gcc-x86-emit-cld.patch Tue Jun 10 22:10:40 2008 +0000
8.3 @@ -0,0 +1,156 @@
8.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/20_all_gcc-x86-emit-cld.patch
8.5 +bandaid for the cld issue. to be dropped when gcc-4.3 goes stable.
8.6 +
8.7 +http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00417.html
8.8 +
8.9 +2008-03-06 Uros Bizjak <ubizjak@gmail.com>
8.10 +
8.11 + * config/i386/i386.h (TARGET_CLD): New define.
8.12 + (struct machine_function): Add needs_cld field.
8.13 + (ix86_current_function_needs_cld): New define.
8.14 + * config/i386/i386.md (UNSPEC_CLD): New unspec volatile constant.
8.15 + ("cld"): New isns pattern.
8.16 + ("strmov_singleop"): Set ix86_current_function_needs_cld flag.
8.17 + ("rep_mov"): Ditto.
8.18 + ("strset_singleop"): Ditto.
8.19 + ("rep_stos"): Ditto.
8.20 + ("cmpstrnqi_nz_1"): Ditto.
8.21 + ("cmpstrnqi_1"): Ditto.
8.22 + ("strlenqi_1"): Ditto.
8.23 + * config/i386/i386.c (ix86_expand_prologue): Emit cld insn for
8.24 + TARGET_CLD when ix86_current_function_needs_cld is set.
8.25 +
8.26 +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.c gcc-4.3.0/gcc/config/i386/i386.c
8.27 +--- gcc-4.3.0.orig/gcc/config/i386/i386.c 2008-02-21 13:30:00.000000000 +0100
8.28 ++++ gcc-4.3.0/gcc/config/i386/i386.c 2008-06-10 14:44:37.000000000 +0200
8.29 +@@ -6448,6 +6448,10 @@
8.30 + emit_insn (gen_prologue_use (pic_offset_table_rtx));
8.31 + emit_insn (gen_blockage ());
8.32 + }
8.33 ++
8.34 ++ /* Emit cld instruction if stringops are used in the function. */
8.35 ++ if (TARGET_CLD && ix86_current_function_needs_cld)
8.36 ++ emit_insn (gen_cld ());
8.37 + }
8.38 +
8.39 + /* Emit code to restore saved registers using MOV insns. First register
8.40 +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.h gcc-4.3.0/gcc/config/i386/i386.h
8.41 +--- gcc-4.3.0.orig/gcc/config/i386/i386.h 2008-02-15 09:12:02.000000000 +0100
8.42 ++++ gcc-4.3.0/gcc/config/i386/i386.h 2008-06-10 14:44:37.000000000 +0200
8.43 +@@ -388,6 +388,7 @@
8.44 +
8.45 + extern int x86_prefetch_sse;
8.46 +
8.47 ++#define TARGET_CLD 1
8.48 + #define TARGET_ABM x86_abm
8.49 + #define TARGET_CMPXCHG16B x86_cmpxchg16b
8.50 + #define TARGET_POPCNT x86_popcnt
8.51 +@@ -2443,8 +2444,9 @@
8.52 + int save_varrargs_registers;
8.53 + int accesses_prev_frame;
8.54 + int optimize_mode_switching[MAX_386_ENTITIES];
8.55 +- /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to
8.56 +- determine the style used. */
8.57 ++ int needs_cld;
8.58 ++ /* Set by ix86_compute_frame_layout and used by prologue/epilogue
8.59 ++ expander to determine the style used. */
8.60 + int use_fast_prologue_epilogue;
8.61 + /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed
8.62 + for. */
8.63 +@@ -2464,6 +2466,7 @@
8.64 + #define ix86_stack_locals (cfun->machine->stack_locals)
8.65 + #define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers)
8.66 + #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
8.67 ++#define ix86_current_function_needs_cld (cfun->machine->needs_cld)
8.68 + #define ix86_tls_descriptor_calls_expanded_in_cfun \
8.69 + (cfun->machine->tls_descriptor_call_expanded_p)
8.70 + /* Since tls_descriptor_call_expanded is not cleared, even if all TLS
8.71 +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.md gcc-4.3.0/gcc/config/i386/i386.md
8.72 +--- gcc-4.3.0.orig/gcc/config/i386/i386.md 2008-02-06 12:34:00.000000000 +0100
8.73 ++++ gcc-4.3.0/gcc/config/i386/i386.md 2008-06-10 14:44:37.000000000 +0200
8.74 +@@ -205,6 +205,7 @@
8.75 + (UNSPECV_XCHG 12)
8.76 + (UNSPECV_LOCK 13)
8.77 + (UNSPECV_PROLOGUE_USE 14)
8.78 ++ (UNSPECV_CLD 15)
8.79 + ])
8.80 +
8.81 + ;; Constants to represent pcomtrue/pcomfalse variants
8.82 +@@ -18529,6 +18530,14 @@
8.83 +
8.84 + ;; Block operation instructions
8.85 +
8.86 ++(define_insn "cld"
8.87 ++ [(unspec_volatile [(const_int 0)] UNSPECV_CLD)]
8.88 ++ ""
8.89 ++ "cld"
8.90 ++ [(set_attr "length" "1")
8.91 ++ (set_attr "length_immediate" "0")
8.92 ++ (set_attr "modrm" "0")])
8.93 ++
8.94 + (define_expand "movmemsi"
8.95 + [(use (match_operand:BLK 0 "memory_operand" ""))
8.96 + (use (match_operand:BLK 1 "memory_operand" ""))
8.97 +@@ -18601,7 +18610,7 @@
8.98 + (set (match_operand 2 "register_operand" "")
8.99 + (match_operand 5 "" ""))])]
8.100 + "TARGET_SINGLE_STRINGOP || optimize_size"
8.101 +- "")
8.102 ++ "ix86_current_function_needs_cld = 1;")
8.103 +
8.104 + (define_insn "*strmovdi_rex_1"
8.105 + [(set (mem:DI (match_operand:DI 2 "register_operand" "0"))
8.106 +@@ -18718,7 +18727,7 @@
8.107 + (match_operand 3 "memory_operand" ""))
8.108 + (use (match_dup 4))])]
8.109 + ""
8.110 +- "")
8.111 ++ "ix86_current_function_needs_cld = 1;")
8.112 +
8.113 + (define_insn "*rep_movdi_rex64"
8.114 + [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
8.115 +@@ -18878,7 +18887,7 @@
8.116 + (set (match_operand 0 "register_operand" "")
8.117 + (match_operand 3 "" ""))])]
8.118 + "TARGET_SINGLE_STRINGOP || optimize_size"
8.119 +- "")
8.120 ++ "ix86_current_function_needs_cld = 1;")
8.121 +
8.122 + (define_insn "*strsetdi_rex_1"
8.123 + [(set (mem:DI (match_operand:DI 1 "register_operand" "0"))
8.124 +@@ -18972,7 +18981,7 @@
8.125 + (use (match_operand 3 "register_operand" ""))
8.126 + (use (match_dup 1))])]
8.127 + ""
8.128 +- "")
8.129 ++ "ix86_current_function_needs_cld = 1;")
8.130 +
8.131 + (define_insn "*rep_stosdi_rex64"
8.132 + [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
8.133 +@@ -19148,7 +19157,7 @@
8.134 + (clobber (match_operand 1 "register_operand" ""))
8.135 + (clobber (match_dup 2))])]
8.136 + ""
8.137 +- "")
8.138 ++ "ix86_current_function_needs_cld = 1;")
8.139 +
8.140 + (define_insn "*cmpstrnqi_nz_1"
8.141 + [(set (reg:CC FLAGS_REG)
8.142 +@@ -19195,7 +19204,7 @@
8.143 + (clobber (match_operand 1 "register_operand" ""))
8.144 + (clobber (match_dup 2))])]
8.145 + ""
8.146 +- "")
8.147 ++ "ix86_current_function_needs_cld = 1;")
8.148 +
8.149 + (define_insn "*cmpstrnqi_1"
8.150 + [(set (reg:CC FLAGS_REG)
8.151 +@@ -19264,7 +19273,7 @@
8.152 + (clobber (match_operand 1 "register_operand" ""))
8.153 + (clobber (reg:CC FLAGS_REG))])]
8.154 + ""
8.155 +- "")
8.156 ++ "ix86_current_function_needs_cld = 1;")
8.157 +
8.158 + (define_insn "*strlenqi_1"
8.159 + [(set (match_operand:SI 0 "register_operand" "=&c")
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/patches/gcc/4.3.0/300-gcc-3.4-libiberty-pic.patch Tue Jun 10 22:10:40 2008 +0000
9.3 @@ -0,0 +1,12 @@
9.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/51_all_gcc-3.4-libiberty-pic.patch
9.5 +diff -durN gcc-4.3.0.orig/libiberty/Makefile.in gcc-4.3.0/libiberty/Makefile.in
9.6 +--- gcc-4.3.0.orig/libiberty/Makefile.in 2007-07-25 08:26:45.000000000 +0200
9.7 ++++ gcc-4.3.0/libiberty/Makefile.in 2008-06-10 14:44:43.000000000 +0200
9.8 +@@ -225,6 +225,7 @@
9.9 + $(AR) $(AR_FLAGS) $(TARGETLIB) \
9.10 + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
9.11 + $(RANLIB) $(TARGETLIB); \
9.12 ++ cp $(TARGETLIB) ../ ; \
9.13 + cd ..; \
9.14 + else true; fi
9.15 +
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/patches/gcc/4.3.0/325-gcc4-superh-default-multilib.patch Tue Jun 10 22:10:40 2008 +0000
10.3 @@ -0,0 +1,25 @@
10.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/53_all_gcc4-superh-default-multilib.patch
10.5 +The gcc-3.x toolchains would contain all the targets by default. With gcc-4,
10.6 +you have to actually list out the multilibs you want or you will end up with
10.7 +just one when using targets like 'sh4-linux-gnu'.
10.8 +
10.9 +The resulting toolchain can't even build a kernel as the kernel needs to build
10.10 +with the nofpu flag to be sure that no fpu ops are generated.
10.11 +
10.12 +Here we restore the gcc-3.x behavior; the additional overhead of building all
10.13 +of these multilibs by default is negligible.
10.14 +
10.15 +http://bugs.gentoo.org/140205
10.16 +
10.17 +diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
10.18 +--- gcc-4.3.0.orig/gcc/config.gcc 2008-01-29 17:28:10.000000000 +0100
10.19 ++++ gcc-4.3.0/gcc/config.gcc 2008-06-10 14:44:47.000000000 +0200
10.20 +@@ -2271,7 +2271,7 @@
10.21 + if test x${sh_multilibs} = x ; then
10.22 + case ${target} in
10.23 + sh64-superh-linux* | \
10.24 +- sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
10.25 ++ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
10.26 + sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
10.27 + sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
10.28 + sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;;
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/patches/gcc/4.3.0/350-300-libstdc++-pic.patch Tue Jun 10 22:10:40 2008 +0000
11.3 @@ -0,0 +1,56 @@
11.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/54_all_300-libstdc++-pic.patch
11.5 +install libstdc++_pic.a if we have pic objs
11.6 +
11.7 +diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am gcc-4.3.0/libstdc++-v3/src/Makefile.am
11.8 +--- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am 2008-02-29 19:26:50.000000000 +0100
11.9 ++++ gcc-4.3.0/libstdc++-v3/src/Makefile.am 2008-06-10 14:44:51.000000000 +0200
11.10 +@@ -289,6 +289,13 @@
11.11 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
11.12 +
11.13 +
11.14 ++install-exec-local:
11.15 ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
11.16 ++ if [ x"$$pic_objs" != x ]; then \
11.17 ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
11.18 ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
11.19 ++ fi
11.20 ++
11.21 + # Added bits to build debug library.
11.22 + if GLIBCXX_BUILD_DEBUG
11.23 + all-local: build_debug
11.24 +diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in gcc-4.3.0/libstdc++-v3/src/Makefile.in
11.25 +--- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in 2008-02-29 19:26:50.000000000 +0100
11.26 ++++ gcc-4.3.0/libstdc++-v3/src/Makefile.in 2008-06-10 14:44:51.000000000 +0200
11.27 +@@ -693,7 +693,7 @@
11.28 +
11.29 + install-data-am: install-data-local
11.30 +
11.31 +-install-exec-am: install-toolexeclibLTLIBRARIES
11.32 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
11.33 +
11.34 + install-info: install-info-am
11.35 +
11.36 +@@ -732,7 +732,7 @@
11.37 + maintainer-clean-generic mostlyclean mostlyclean-compile \
11.38 + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
11.39 + tags uninstall uninstall-am uninstall-info-am \
11.40 +- uninstall-toolexeclibLTLIBRARIES
11.41 ++ uninstall-toolexeclibLTLIBRARIES install-exec-local
11.42 +
11.43 +
11.44 + # Symbol versioning for shared libraries.
11.45 +@@ -858,6 +858,14 @@
11.46 + install_debug:
11.47 + (cd ${debugdir} && $(MAKE) \
11.48 + toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
11.49 ++
11.50 ++install-exec-local:
11.51 ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
11.52 ++ if [ x"$$pic_objs" != x ]; then \
11.53 ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
11.54 ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
11.55 ++ fi
11.56 ++
11.57 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
11.58 + # Otherwise a system limit (for SysV at least) may be exceeded.
11.59 + .NOEXPORT:
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/patches/gcc/4.3.0/375-gcc43-pr35440.patch Tue Jun 10 22:10:40 2008 +0000
12.3 @@ -0,0 +1,59 @@
12.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/60_all_gcc43-pr35440.patch
12.5 +2008-03-19 Jakub Jelinek <jakub@redhat.com>
12.6 +
12.7 + PR c/35440
12.8 + * c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR
12.9 + for all types.
12.10 +
12.11 + * gcc.dg/pr35440.c: New test.
12.12 +
12.13 +diff -durN gcc-4.3.0.orig/gcc/c-pretty-print.c gcc-4.3.0/gcc/c-pretty-print.c
12.14 +--- gcc-4.3.0.orig/gcc/c-pretty-print.c 2008-01-29 14:59:59.000000000 +0100
12.15 ++++ gcc-4.3.0/gcc/c-pretty-print.c 2008-06-10 14:44:54.000000000 +0200
12.16 +@@ -1173,6 +1173,12 @@
12.17 + tree type = TREE_TYPE (e);
12.18 + const enum tree_code code = TREE_CODE (type);
12.19 +
12.20 ++ if (TREE_CODE (e) == CONSTRUCTOR)
12.21 ++ {
12.22 ++ pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
12.23 ++ return;
12.24 ++ }
12.25 ++
12.26 + switch (code)
12.27 + {
12.28 + case RECORD_TYPE:
12.29 +@@ -1207,16 +1213,12 @@
12.30 + case VECTOR_TYPE:
12.31 + if (TREE_CODE (e) == VECTOR_CST)
12.32 + pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e));
12.33 +- else if (TREE_CODE (e) == CONSTRUCTOR)
12.34 +- pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
12.35 + else
12.36 + break;
12.37 + return;
12.38 +
12.39 + case COMPLEX_TYPE:
12.40 +- if (TREE_CODE (e) == CONSTRUCTOR)
12.41 +- pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
12.42 +- else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
12.43 ++ if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
12.44 + {
12.45 + const bool cst = TREE_CODE (e) == COMPLEX_CST;
12.46 + pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0));
12.47 +diff -durN gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c
12.48 +--- gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c 1970-01-01 01:00:00.000000000 +0100
12.49 ++++ gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c 2008-06-10 14:44:54.000000000 +0200
12.50 +@@ -0,0 +1,12 @@
12.51 ++/* PR c/35440 */
12.52 ++/* { dg-do compile } */
12.53 ++/* { dg-options "-std=gnu99" } */
12.54 ++
12.55 ++struct A {};
12.56 ++struct B { int i; char j[2]; };
12.57 ++
12.58 ++void foo (void)
12.59 ++{
12.60 ++ (struct A){}(); /* { dg-error "called object" } */
12.61 ++ (struct B){ .i = 2, .j[1] = 1 }(); /* { dg-error "called object" } */
12.62 ++}
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/patches/gcc/4.3.0/400-gcc43-pr24170.patch Tue Jun 10 22:10:40 2008 +0000
13.3 @@ -0,0 +1,61 @@
13.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc43-pr24170.patch
13.5 +http://gcc.gnu.org/PR24170
13.6 +
13.7 +2008-02-20 Tom Tromey <tromey@redhat.com>
13.8 +
13.9 + PR libgcj/24170:
13.10 + * java/io/natFilePosix.cc (File::performList): Don't use
13.11 + readdir_r.
13.12 + * configure, include/config.h.in: Rebuilt.
13.13 + * configure.ac: Don't check for readdir_r.
13.14 +
13.15 +diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
13.16 +--- gcc-4.3.0.orig/libjava/configure.ac 2008-06-10 14:44:17.000000000 +0200
13.17 ++++ gcc-4.3.0/libjava/configure.ac 2008-06-10 14:44:58.000000000 +0200
13.18 +@@ -1030,7 +1030,7 @@
13.19 + PLATFORMNET=NoNet
13.20 + else
13.21 + AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
13.22 +- localtime_r readdir_r getpwuid_r getcwd \
13.23 ++ localtime_r getpwuid_r getcwd \
13.24 + access stat lstat mkdir rename rmdir unlink utime chmod readlink \
13.25 + nl_langinfo setlocale \
13.26 + inet_pton uname inet_ntoa \
13.27 +diff -durN gcc-4.3.0.orig/libjava/include/config.h.in gcc-4.3.0/libjava/include/config.h.in
13.28 +--- gcc-4.3.0.orig/libjava/include/config.h.in 2007-07-31 18:17:21.000000000 +0200
13.29 ++++ gcc-4.3.0/libjava/include/config.h.in 2008-06-10 14:44:58.000000000 +0200
13.30 +@@ -214,9 +214,6 @@
13.31 + /* Define to 1 if you have the <pwd.h> header file. */
13.32 + #undef HAVE_PWD_H
13.33 +
13.34 +-/* Define to 1 if you have the `readdir_r' function. */
13.35 +-#undef HAVE_READDIR_R
13.36 +-
13.37 + /* Define to 1 if you have the `readlink' function. */
13.38 + #undef HAVE_READLINK
13.39 +
13.40 +diff -durN gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc gcc-4.3.0/libjava/java/io/natFilePosix.cc
13.41 +--- gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc 2007-08-04 23:50:01.000000000 +0200
13.42 ++++ gcc-4.3.0/libjava/java/io/natFilePosix.cc 2008-06-10 14:44:58.000000000 +0200
13.43 +@@ -1,6 +1,6 @@
13.44 + // natFile.cc - Native part of File class for POSIX.
13.45 +
13.46 +-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
13.47 ++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
13.48 + Free Software Foundation
13.49 +
13.50 + This file is part of libgcj.
13.51 +@@ -292,13 +292,7 @@
13.52 +
13.53 + java::util::ArrayList *list = new java::util::ArrayList ();
13.54 + struct dirent *d;
13.55 +-#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
13.56 +- int name_max = pathconf (buf, _PC_NAME_MAX);
13.57 +- char dbuf[sizeof (struct dirent) + name_max + 1];
13.58 +- while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
13.59 +-#else /* HAVE_READDIR_R */
13.60 + while ((d = readdir (dir)) != NULL)
13.61 +-#endif /* HAVE_READDIR_R */
13.62 + {
13.63 + // Omit "." and "..".
13.64 + if (d->d_name[0] == '.'
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/patches/gcc/4.3.0/425-gcc4-ia64-noteGNUstack.patch Tue Jun 10 22:10:40 2008 +0000
14.3 @@ -0,0 +1,96 @@
14.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
14.5 +2004-09-20 Jakub Jelinek <jakub@redhat.com>
14.6 +
14.7 + * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
14.8 + on ppc64-linux.
14.9 +
14.10 + * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
14.11 + ia64-linux.
14.12 + * config/ia64/crtbegin.asm: Likewise.
14.13 + * config/ia64/crtend.asm: Likewise.
14.14 + * config/ia64/crti.asm: Likewise.
14.15 + * config/ia64/crtn.asm: Likewise.
14.16 +
14.17 +2004-05-14 Jakub Jelinek <jakub@redhat.com>
14.18 +
14.19 + * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
14.20 +
14.21 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.0/gcc/config/ia64/crtbegin.asm
14.22 +--- gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm 2005-09-27 02:52:24.000000000 +0200
14.23 ++++ gcc-4.3.0/gcc/config/ia64/crtbegin.asm 2008-06-10 14:45:02.000000000 +0200
14.24 +@@ -255,3 +255,7 @@
14.25 + .weak __cxa_finalize
14.26 + #endif
14.27 + .weak _Jv_RegisterClasses
14.28 ++
14.29 ++#ifdef __linux__
14.30 ++.section .note.GNU-stack; .previous
14.31 ++#endif
14.32 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtend.asm gcc-4.3.0/gcc/config/ia64/crtend.asm
14.33 +--- gcc-4.3.0.orig/gcc/config/ia64/crtend.asm 2005-09-27 02:52:24.000000000 +0200
14.34 ++++ gcc-4.3.0/gcc/config/ia64/crtend.asm 2008-06-10 14:45:02.000000000 +0200
14.35 +@@ -122,3 +122,7 @@
14.36 +
14.37 + br.ret.sptk.many rp
14.38 + .endp __do_global_ctors_aux
14.39 ++
14.40 ++#ifdef __linux__
14.41 ++.section .note.GNU-stack; .previous
14.42 ++#endif
14.43 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crti.asm gcc-4.3.0/gcc/config/ia64/crti.asm
14.44 +--- gcc-4.3.0.orig/gcc/config/ia64/crti.asm 2005-06-25 03:22:41.000000000 +0200
14.45 ++++ gcc-4.3.0/gcc/config/ia64/crti.asm 2008-06-10 14:45:02.000000000 +0200
14.46 +@@ -64,3 +64,7 @@
14.47 + .body
14.48 +
14.49 + # end of crti.asm
14.50 ++
14.51 ++#ifdef __linux__
14.52 ++.section .note.GNU-stack; .previous
14.53 ++#endif
14.54 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtn.asm gcc-4.3.0/gcc/config/ia64/crtn.asm
14.55 +--- gcc-4.3.0.orig/gcc/config/ia64/crtn.asm 2005-06-25 03:22:41.000000000 +0200
14.56 ++++ gcc-4.3.0/gcc/config/ia64/crtn.asm 2008-06-10 14:45:02.000000000 +0200
14.57 +@@ -54,3 +54,7 @@
14.58 + br.ret.sptk.many b0
14.59 +
14.60 + # end of crtn.asm
14.61 ++
14.62 ++#ifdef __linux__
14.63 ++.section .note.GNU-stack; .previous
14.64 ++#endif
14.65 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.0/gcc/config/ia64/lib1funcs.asm
14.66 +--- gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm 2005-09-27 02:52:24.000000000 +0200
14.67 ++++ gcc-4.3.0/gcc/config/ia64/lib1funcs.asm 2008-06-10 14:45:02.000000000 +0200
14.68 +@@ -792,3 +792,7 @@
14.69 + }
14.70 + .endp __floattitf
14.71 + #endif
14.72 ++
14.73 ++#ifdef __linux__
14.74 ++.section .note.GNU-stack; .previous
14.75 ++#endif
14.76 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/linux.h gcc-4.3.0/gcc/config/ia64/linux.h
14.77 +--- gcc-4.3.0.orig/gcc/config/ia64/linux.h 2006-12-12 16:15:19.000000000 +0100
14.78 ++++ gcc-4.3.0/gcc/config/ia64/linux.h 2008-06-10 14:45:02.000000000 +0200
14.79 +@@ -5,6 +5,8 @@
14.80 +
14.81 + #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
14.82 +
14.83 ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
14.84 ++
14.85 + /* This is for -profile to use -lc_p instead of -lc. */
14.86 + #undef CC1_SPEC
14.87 + #define CC1_SPEC "%{profile:-p} %{G*}"
14.88 +diff -durN gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.0/gcc/config/rs6000/ppc-asm.h
14.89 +--- gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h 2003-06-04 18:44:51.000000000 +0200
14.90 ++++ gcc-4.3.0/gcc/config/rs6000/ppc-asm.h 2008-06-10 14:45:02.000000000 +0200
14.91 +@@ -158,7 +158,7 @@
14.92 + .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
14.93 + #endif
14.94 +
14.95 +-#if defined __linux__ && !defined __powerpc64__
14.96 ++#if defined __linux__
14.97 + .section .note.GNU-stack
14.98 + .previous
14.99 + #endif
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/patches/gcc/4.3.0/450-gcc4-noteGNUstack.patch Tue Jun 10 22:10:40 2008 +0000
15.3 @@ -0,0 +1,198 @@
15.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/62_all_gcc4-noteGNUstack.patch
15.5 +2005-02-08 Jakub Jelinek <jakub@redhat.com>
15.6 +
15.7 + * src/alpha/osf.S: Add .note.GNU-stack on Linux.
15.8 + * src/s390/sysv.S: Likewise.
15.9 + * src/powerpc/linux64.S: Likewise.
15.10 + * src/powerpc/linux64_closure.S: Likewise.
15.11 + * src/powerpc/ppc_closure.S: Likewise.
15.12 + * src/powerpc/sysv.S: Likewise.
15.13 + * src/x86/unix64.S: Likewise.
15.14 + * src/x86/sysv.S: Likewise.
15.15 + * src/sparc/v8.S: Likewise.
15.16 + * src/sparc/v9.S: Likewise.
15.17 + * src/m68k/sysv.S: Likewise.
15.18 + * src/ia64/unix.S: Likewise.
15.19 + * src/arm/sysv.S: Likewise.
15.20 +
15.21 + * ia64_save_regs_in_stack.s: Moved to...
15.22 + * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack
15.23 + on Linux.
15.24 +
15.25 +diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S
15.26 +--- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S 1970-01-01 01:00:00.000000000 +0100
15.27 ++++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S 2008-06-10 14:45:05.000000000 +0200
15.28 +@@ -0,0 +1,15 @@
15.29 ++ .text
15.30 ++ .align 16
15.31 ++ .global GC_save_regs_in_stack
15.32 ++ .proc GC_save_regs_in_stack
15.33 ++GC_save_regs_in_stack:
15.34 ++ .bodyfoo.mpg
15.35 ++ flushrs
15.36 ++ ;;
15.37 ++ mov r8=ar.bsp
15.38 ++ br.ret.sptk.few rp
15.39 ++ .endp GC_save_regs_in_stack
15.40 ++
15.41 ++#ifdef __linux__
15.42 ++ .section .note.GNU-stack,"",@progbits
15.43 ++#endif
15.44 +diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s
15.45 +--- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s 2001-10-15 06:57:59.000000000 +0200
15.46 ++++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s 2008-06-10 14:45:05.000000000 +0200
15.47 +@@ -1,12 +0,0 @@
15.48 +- .text
15.49 +- .align 16
15.50 +- .global GC_save_regs_in_stack
15.51 +- .proc GC_save_regs_in_stack
15.52 +-GC_save_regs_in_stack:
15.53 +- .body
15.54 +- flushrs
15.55 +- ;;
15.56 +- mov r8=ar.bsp
15.57 +- br.ret.sptk.few rp
15.58 +- .endp GC_save_regs_in_stack
15.59 +-
15.60 +diff -durN gcc-4.3.0.orig/libffi/src/alpha/osf.S gcc-4.3.0/libffi/src/alpha/osf.S
15.61 +--- gcc-4.3.0.orig/libffi/src/alpha/osf.S 2007-04-06 18:24:16.000000000 +0200
15.62 ++++ gcc-4.3.0/libffi/src/alpha/osf.S 2008-06-10 14:45:05.000000000 +0200
15.63 +@@ -358,4 +358,8 @@
15.64 + .byte 16 # uleb128 offset 16*-8
15.65 + .align 3
15.66 + $LEFDE3:
15.67 ++
15.68 ++#ifdef __linux__
15.69 ++ .section .note.GNU-stack,"",@progbits
15.70 ++#endif
15.71 + #endif
15.72 +diff -durN gcc-4.3.0.orig/libffi/src/arm/sysv.S gcc-4.3.0/libffi/src/arm/sysv.S
15.73 +--- gcc-4.3.0.orig/libffi/src/arm/sysv.S 2007-09-04 19:52:45.000000000 +0200
15.74 ++++ gcc-4.3.0/libffi/src/arm/sysv.S 2008-06-10 14:45:05.000000000 +0200
15.75 +@@ -293,3 +293,6 @@
15.76 + UNWIND .fnend
15.77 + .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
15.78 +
15.79 ++#if defined __ELF__ && defined __linux__
15.80 ++ .section .note.GNU-stack,"",%progbits
15.81 ++#endif
15.82 +diff -durN gcc-4.3.0.orig/libffi/src/ia64/unix.S gcc-4.3.0/libffi/src/ia64/unix.S
15.83 +--- gcc-4.3.0.orig/libffi/src/ia64/unix.S 2005-03-30 23:49:19.000000000 +0200
15.84 ++++ gcc-4.3.0/libffi/src/ia64/unix.S 2008-06-10 14:45:05.000000000 +0200
15.85 +@@ -553,3 +553,7 @@
15.86 + data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
15.87 + data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
15.88 + data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
15.89 ++
15.90 ++#if defined __ELF__ && defined __linux__
15.91 ++ .section .note.GNU-stack,"",@progbits
15.92 ++#endif
15.93 +diff -durN gcc-4.3.0.orig/libffi/src/m68k/sysv.S gcc-4.3.0/libffi/src/m68k/sysv.S
15.94 +--- gcc-4.3.0.orig/libffi/src/m68k/sysv.S 2007-05-10 23:29:04.000000000 +0200
15.95 ++++ gcc-4.3.0/libffi/src/m68k/sysv.S 2008-06-10 14:45:05.000000000 +0200
15.96 +@@ -207,3 +207,7 @@
15.97 + rts
15.98 + CFI_ENDPROC()
15.99 + .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
15.100 ++
15.101 ++#if defined __ELF__ && defined __linux__
15.102 ++ .section .note.GNU-stack,"",@progbits
15.103 ++#endif
15.104 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64.S gcc-4.3.0/libffi/src/powerpc/linux64.S
15.105 +--- gcc-4.3.0.orig/libffi/src/powerpc/linux64.S 2007-11-17 00:24:53.000000000 +0100
15.106 ++++ gcc-4.3.0/libffi/src/powerpc/linux64.S 2008-06-10 14:45:05.000000000 +0200
15.107 +@@ -179,3 +179,7 @@
15.108 + .align 3
15.109 + .LEFDE1:
15.110 + #endif
15.111 ++
15.112 ++#if defined __ELF__ && defined __linux__
15.113 ++ .section .note.GNU-stack,"",@progbits
15.114 ++#endif
15.115 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.0/libffi/src/powerpc/linux64_closure.S
15.116 +--- gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S 2005-08-11 23:18:24.000000000 +0200
15.117 ++++ gcc-4.3.0/libffi/src/powerpc/linux64_closure.S 2008-06-10 14:45:05.000000000 +0200
15.118 +@@ -204,3 +204,7 @@
15.119 + .align 3
15.120 + .LEFDE1:
15.121 + #endif
15.122 ++
15.123 ++#if defined __ELF__ && defined __linux__
15.124 ++ .section .note.GNU-stack,"",@progbits
15.125 ++#endif
15.126 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.0/libffi/src/powerpc/ppc_closure.S
15.127 +--- gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S 2007-12-01 22:00:04.000000000 +0100
15.128 ++++ gcc-4.3.0/libffi/src/powerpc/ppc_closure.S 2008-06-10 14:45:05.000000000 +0200
15.129 +@@ -295,3 +295,7 @@
15.130 + .LEFDE1:
15.131 +
15.132 + #endif
15.133 ++
15.134 ++#if defined __ELF__ && defined __linux__
15.135 ++ .section .note.GNU-stack,"",@progbits
15.136 ++#endif
15.137 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/sysv.S gcc-4.3.0/libffi/src/powerpc/sysv.S
15.138 +--- gcc-4.3.0.orig/libffi/src/powerpc/sysv.S 2007-12-01 22:00:04.000000000 +0100
15.139 ++++ gcc-4.3.0/libffi/src/powerpc/sysv.S 2008-06-10 14:45:05.000000000 +0200
15.140 +@@ -223,3 +223,7 @@
15.141 + .align 2
15.142 + .LEFDE1:
15.143 + #endif
15.144 ++
15.145 ++#if defined __ELF__ && defined __linux__
15.146 ++ .section .note.GNU-stack,"",@progbits
15.147 ++#endif
15.148 +diff -durN gcc-4.3.0.orig/libffi/src/s390/sysv.S gcc-4.3.0/libffi/src/s390/sysv.S
15.149 +--- gcc-4.3.0.orig/libffi/src/s390/sysv.S 2003-10-21 21:01:58.000000000 +0200
15.150 ++++ gcc-4.3.0/libffi/src/s390/sysv.S 2008-06-10 14:45:05.000000000 +0200
15.151 +@@ -427,3 +427,6 @@
15.152 +
15.153 + #endif
15.154 +
15.155 ++#if defined __ELF__ && defined __linux__
15.156 ++ .section .note.GNU-stack,"",@progbits
15.157 ++#endif
15.158 +diff -durN gcc-4.3.0.orig/libffi/src/sparc/v8.S gcc-4.3.0/libffi/src/sparc/v8.S
15.159 +--- gcc-4.3.0.orig/libffi/src/sparc/v8.S 2004-11-22 19:35:16.000000000 +0100
15.160 ++++ gcc-4.3.0/libffi/src/sparc/v8.S 2008-06-10 14:45:05.000000000 +0200
15.161 +@@ -265,3 +265,7 @@
15.162 + .byte 0x1f ! uleb128 0x1f
15.163 + .align WS
15.164 + .LLEFDE2:
15.165 ++
15.166 ++#if defined __ELF__ && defined __linux__
15.167 ++ .section .note.GNU-stack,"",@progbits
15.168 ++#endif
15.169 +diff -durN gcc-4.3.0.orig/libffi/src/sparc/v9.S gcc-4.3.0/libffi/src/sparc/v9.S
15.170 +--- gcc-4.3.0.orig/libffi/src/sparc/v9.S 2004-01-25 07:58:33.000000000 +0100
15.171 ++++ gcc-4.3.0/libffi/src/sparc/v9.S 2008-06-10 14:45:05.000000000 +0200
15.172 +@@ -300,3 +300,7 @@
15.173 + .align 8
15.174 + .LLEFDE2:
15.175 + #endif
15.176 ++
15.177 ++#ifdef __linux__
15.178 ++ .section .note.GNU-stack,"",@progbits
15.179 ++#endif
15.180 +diff -durN gcc-4.3.0.orig/libffi/src/x86/sysv.S gcc-4.3.0/libffi/src/x86/sysv.S
15.181 +--- gcc-4.3.0.orig/libffi/src/x86/sysv.S 2008-01-30 15:36:58.000000000 +0100
15.182 ++++ gcc-4.3.0/libffi/src/x86/sysv.S 2008-06-10 14:45:05.000000000 +0200
15.183 +@@ -430,3 +430,7 @@
15.184 + #endif
15.185 +
15.186 + #endif /* ifndef __x86_64__ */
15.187 ++
15.188 ++#if defined __ELF__ && defined __linux__
15.189 ++ .section .note.GNU-stack,"",@progbits
15.190 ++#endif
15.191 +diff -durN gcc-4.3.0.orig/libffi/src/x86/unix64.S gcc-4.3.0/libffi/src/x86/unix64.S
15.192 +--- gcc-4.3.0.orig/libffi/src/x86/unix64.S 2005-05-05 06:06:38.000000000 +0200
15.193 ++++ gcc-4.3.0/libffi/src/x86/unix64.S 2008-06-10 14:45:05.000000000 +0200
15.194 +@@ -410,3 +410,7 @@
15.195 + .LEFDE3:
15.196 +
15.197 + #endif /* __x86_64__ */
15.198 ++
15.199 ++#if defined __ELF__ && defined __linux__
15.200 ++ .section .note.GNU-stack,"",@progbits
15.201 ++#endif
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/patches/gcc/4.3.0/475-gcc43-pr35705.patch Tue Jun 10 22:10:40 2008 +0000
16.3 @@ -0,0 +1,21 @@
16.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/63_all_gcc43-pr35705.patch
16.5 +http://gcc.gnu.org/PR35705
16.6 +
16.7 +2008-04-01 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
16.8 +
16.9 + PR middle-end/35705
16.10 + * fold-const.c (get_pointer_modulus_and_residue): Return modulus 1 if
16.11 + the expression is a function address.
16.12 +
16.13 +diff -durN gcc-4.3.0.orig/gcc/fold-const.c gcc-4.3.0/gcc/fold-const.c
16.14 +--- gcc-4.3.0.orig/gcc/fold-const.c 2008-02-27 15:12:33.000000000 +0100
16.15 ++++ gcc-4.3.0/gcc/fold-const.c 2008-06-10 14:45:09.000000000 +0200
16.16 +@@ -9357,7 +9357,7 @@
16.17 + }
16.18 + }
16.19 +
16.20 +- if (DECL_P (expr))
16.21 ++ if (DECL_P (expr) && TREE_CODE (expr) != FUNCTION_DECL)
16.22 + return DECL_ALIGN_UNIT (expr);
16.23 + }
16.24 + else if (code == POINTER_PLUS_EXPR)
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
17.2 +++ b/patches/gcc/4.3.0/500-gcc43-pr34571.patch Tue Jun 10 22:10:40 2008 +0000
17.3 @@ -0,0 +1,35 @@
17.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/64_all_gcc43-pr34571.patch
17.5 +http://gcc.gnu.org/PR34571
17.6 +
17.7 +2007-12-26 Rask Ingemann Lambertsen <rask@sygehus.dk>
17.8 +
17.9 + PR target/34571
17.10 + * config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
17.11 + symbolic_operand.
17.12 + * varasm.c (output_constant_pool_1): Fix typo.
17.13 +
17.14 +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.c gcc-4.3.0/gcc/config/alpha/alpha.c
17.15 +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.c 2008-02-07 18:45:24.000000000 +0100
17.16 ++++ gcc-4.3.0/gcc/config/alpha/alpha.c 2008-06-10 14:45:13.000000000 +0200
17.17 +@@ -1113,8 +1113,7 @@
17.18 + static bool
17.19 + alpha_cannot_force_const_mem (rtx x)
17.20 + {
17.21 +- enum rtx_code code = GET_CODE (x);
17.22 +- return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
17.23 ++ return symbolic_operand (x, GET_MODE (x));
17.24 + }
17.25 +
17.26 + /* We do not allow indirect calls to be optimized into sibling calls, nor
17.27 +diff -durN gcc-4.3.0.orig/gcc/varasm.c gcc-4.3.0/gcc/varasm.c
17.28 +--- gcc-4.3.0.orig/gcc/varasm.c 2007-12-05 22:55:10.000000000 +0100
17.29 ++++ gcc-4.3.0/gcc/varasm.c 2008-06-10 14:45:13.000000000 +0200
17.30 +@@ -3710,7 +3710,7 @@
17.31 + /* FALLTHRU */
17.32 +
17.33 + case LABEL_REF:
17.34 +- tmp = XEXP (x, 0);
17.35 ++ tmp = XEXP (tmp, 0);
17.36 + gcc_assert (!INSN_DELETED_P (tmp));
17.37 + gcc_assert (!NOTE_P (tmp)
17.38 + || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/patches/gcc/4.3.0/525-gcc43-pr35982.patch Tue Jun 10 22:10:40 2008 +0000
18.3 @@ -0,0 +1,23 @@
18.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/65_all_gcc43-pr35982.patch
18.5 +http://gcc.gnu.org/PR35982
18.6 +
18.7 +2008-04-23 Ira Rosen <irar@il.ibm.com>
18.8 +
18.9 + PR tree-optimization/35982
18.10 + * tree-vect-analyze.c (vect_check_interleaving): Check that the
18.11 + interleaved data-refs are of the same type.
18.12 +
18.13 +diff -durN gcc-4.3.0.orig/gcc/tree-vect-analyze.c gcc-4.3.0/gcc/tree-vect-analyze.c
18.14 +--- gcc-4.3.0.orig/gcc/tree-vect-analyze.c 2007-12-06 17:18:55.000000000 +0100
18.15 ++++ gcc-4.3.0/gcc/tree-vect-analyze.c 2008-06-10 14:45:17.000000000 +0200
18.16 +@@ -1081,7 +1081,9 @@
18.17 + type_size_b = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb))));
18.18 +
18.19 + if (type_size_a != type_size_b
18.20 +- || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb)))
18.21 ++ || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb))
18.22 ++ || !types_compatible_p (TREE_TYPE (DR_REF (dra)),
18.23 ++ TREE_TYPE (DR_REF (drb))))
18.24 + return;
18.25 +
18.26 + init_a = TREE_INT_CST_LOW (DR_INIT (dra));
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
19.2 +++ b/patches/gcc/4.3.0/550-gcc43-pr25343.patch Tue Jun 10 22:10:40 2008 +0000
19.3 @@ -0,0 +1,21 @@
19.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/66_all_gcc43-pr25343.patch
19.5 +http://gcc.gnu.org/PR25343
19.6 +
19.7 +sniped from Debian
19.8 +
19.9 +2008-04-27 Roman Zippel <zippel@linux-m68k.org>
19.10 +
19.11 + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
19.12 +
19.13 +diff -durN gcc-4.3.0.orig/gcc/config/host-linux.c gcc-4.3.0/gcc/config/host-linux.c
19.14 +--- gcc-4.3.0.orig/gcc/config/host-linux.c 2007-08-02 12:49:31.000000000 +0200
19.15 ++++ gcc-4.3.0/gcc/config/host-linux.c 2008-06-10 14:45:20.000000000 +0200
19.16 +@@ -84,6 +84,8 @@
19.17 + # define TRY_EMPTY_VM_SPACE 0x8000000000
19.18 + #elif defined(__sparc__)
19.19 + # define TRY_EMPTY_VM_SPACE 0x60000000
19.20 ++#elif defined(__mc68000__)
19.21 ++# define TRY_EMPTY_VM_SPACE 0x40000000
19.22 + #else
19.23 + # define TRY_EMPTY_VM_SPACE 0
19.24 + #endif
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
20.2 +++ b/patches/gcc/4.3.0/575-sh-pr24836.patch Tue Jun 10 22:10:40 2008 +0000
20.3 @@ -0,0 +1,28 @@
20.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/74_all_sh-pr24836.patch
20.5 +http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
20.6 +http://gcc.gnu.org/PR24836
20.7 +
20.8 +diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure
20.9 +--- gcc-4.3.0.orig/gcc/configure 2008-06-10 14:44:21.000000000 +0200
20.10 ++++ gcc-4.3.0/gcc/configure 2008-06-10 14:45:24.000000000 +0200
20.11 +@@ -14700,7 +14700,7 @@
20.12 + tls_first_minor=14
20.13 + tls_as_opt="-m64 -Aesame --fatal-warnings"
20.14 + ;;
20.15 +- sh-*-* | sh[34]-*-*)
20.16 ++ sh-*-* | sh[34]*-*-*)
20.17 + conftest_s='
20.18 + .section ".tdata","awT",@progbits
20.19 + foo: .long 25
20.20 +diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac
20.21 +--- gcc-4.3.0.orig/gcc/configure.ac 2008-06-10 14:44:21.000000000 +0200
20.22 ++++ gcc-4.3.0/gcc/configure.ac 2008-06-10 14:45:24.000000000 +0200
20.23 +@@ -2533,7 +2533,7 @@
20.24 + tls_first_minor=14
20.25 + tls_as_opt="-m64 -Aesame --fatal-warnings"
20.26 + ;;
20.27 +- sh-*-* | sh[34]-*-*)
20.28 ++ sh-*-* | sh[34]*-*-*)
20.29 + conftest_s='
20.30 + .section ".tdata","awT",@progbits
20.31 + foo: .long 25
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
21.2 +++ b/patches/gcc/4.3.0/600-gcc-ca-translation-typo.patch Tue Jun 10 22:10:40 2008 +0000
21.3 @@ -0,0 +1,19 @@
21.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/85_all_gcc-ca-translation-typo.patch
21.5 +http://bugs.gentoo.org/127190
21.6 +
21.7 +2006-03-28 Harald van Dijk <truedfx@gentoo.org>
21.8 +
21.9 + * ca.po: Fix printf flag typo in negative value translation.
21.10 +
21.11 +diff -durN gcc-4.3.0.orig/gcc/po/ca.po gcc-4.3.0/gcc/po/ca.po
21.12 +--- gcc-4.3.0.orig/gcc/po/ca.po 2007-11-10 19:36:27.000000000 +0100
21.13 ++++ gcc-4.3.0/gcc/po/ca.po 2008-06-10 14:45:27.000000000 +0200
21.14 +@@ -36028,7 +36028,7 @@
21.15 + #~ msgstr "passant el valor negatiu `%E' per a %s %P de \"%D\""
21.16 +
21.17 + #~ msgid "%s of negative value `%E' to `%T'"
21.18 +-#~ msgstr "%s de valor negatiu `%I' a \"%T\""
21.19 ++#~ msgstr "%s de valor negatiu `%E' a \"%T\""
21.20 +
21.21 + #~ msgid "initializing array with parameter list"
21.22 + #~ msgstr "inicialitzant una matriu amb una llista de paràmetres"
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22.2 +++ b/patches/gcc/4.3.0/625-103-uclibc-conf-noupstream.patch Tue Jun 10 22:10:40 2008 +0000
22.3 @@ -0,0 +1,13 @@
22.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_103-uclibc-conf-noupstream.patch
22.5 +diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
22.6 +--- gcc-4.3.0.orig/gcc/config.gcc 2008-06-10 14:44:51.000000000 +0200
22.7 ++++ gcc-4.3.0/gcc/config.gcc 2008-06-10 14:45:31.000000000 +0200
22.8 +@@ -2142,7 +2142,7 @@
22.9 + ;;
22.10 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
22.11 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
22.12 +- sh-*-linux* | sh[346lbe]*-*-linux* | \
22.13 ++ sh*-*-linux* | sh[346lbe]*-*-linux* | \
22.14 + sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
22.15 + sh64-*-netbsd* | sh64l*-*-netbsd*)
22.16 + tmake_file="${tmake_file} sh/t-sh sh/t-elf"
23.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
23.2 +++ b/patches/gcc/4.3.0/650-200-uclibc-locale.patch Tue Jun 10 22:10:40 2008 +0000
23.3 @@ -0,0 +1,2794 @@
23.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_200-uclibc-locale.patch
23.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 gcc-4.3.0/libstdc++-v3/acinclude.m4
23.6 +--- gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 2008-02-29 01:00:39.000000000 +0100
23.7 ++++ gcc-4.3.0/libstdc++-v3/acinclude.m4 2008-06-10 14:45:35.000000000 +0200
23.8 +@@ -1349,7 +1349,7 @@
23.9 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
23.10 + GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
23.11 + [use MODEL for target locale package],
23.12 +- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
23.13 ++ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
23.14 +
23.15 + # Deal with gettext issues. Default to not using it (=no) until we detect
23.16 + # support for it later. Let the user turn it off via --e/d, but let that
23.17 +@@ -1370,6 +1370,9 @@
23.18 + # Default to "generic".
23.19 + if test $enable_clocale_flag = auto; then
23.20 + case ${target_os} in
23.21 ++ *-uclibc*)
23.22 ++ enable_clocale_flag=uclibc
23.23 ++ ;;
23.24 + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
23.25 + enable_clocale_flag=gnu
23.26 + ;;
23.27 +@@ -1541,6 +1544,40 @@
23.28 + CTIME_CC=config/locale/generic/time_members.cc
23.29 + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
23.30 + ;;
23.31 ++ uclibc)
23.32 ++ AC_MSG_RESULT(uclibc)
23.33 ++
23.34 ++ # Declare intention to use gettext, and add support for specific
23.35 ++ # languages.
23.36 ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
23.37 ++ ALL_LINGUAS="de fr"
23.38 ++
23.39 ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
23.40 ++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
23.41 ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
23.42 ++ USE_NLS=yes
23.43 ++ fi
23.44 ++ # Export the build objects.
23.45 ++ for ling in $ALL_LINGUAS; do \
23.46 ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
23.47 ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
23.48 ++ done
23.49 ++ AC_SUBST(glibcxx_MOFILES)
23.50 ++ AC_SUBST(glibcxx_POFILES)
23.51 ++
23.52 ++ CLOCALE_H=config/locale/uclibc/c_locale.h
23.53 ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
23.54 ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
23.55 ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
23.56 ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
23.57 ++ CMESSAGES_H=config/locale/uclibc/messages_members.h
23.58 ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
23.59 ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
23.60 ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
23.61 ++ CTIME_H=config/locale/uclibc/time_members.h
23.62 ++ CTIME_CC=config/locale/uclibc/time_members.cc
23.63 ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
23.64 ++ ;;
23.65 + esac
23.66 +
23.67 + # This is where the testsuite looks for locale catalogs, using the
23.68 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
23.69 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100
23.70 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:35.000000000 +0200
23.71 +@@ -0,0 +1,63 @@
23.72 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
23.73 ++
23.74 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
23.75 ++//
23.76 ++// This file is part of the GNU ISO C++ Library. This library is free
23.77 ++// software; you can redistribute it and/or modify it under the
23.78 ++// terms of the GNU General Public License as published by the
23.79 ++// Free Software Foundation; either version 2, or (at your option)
23.80 ++// any later version.
23.81 ++
23.82 ++// This library is distributed in the hope that it will be useful,
23.83 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.84 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.85 ++// GNU General Public License for more details.
23.86 ++
23.87 ++// You should have received a copy of the GNU General Public License along
23.88 ++// with this library; see the file COPYING. If not, write to the Free
23.89 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.90 ++// USA.
23.91 ++
23.92 ++// As a special exception, you may use this file as part of a free software
23.93 ++// library without restriction. Specifically, if other files instantiate
23.94 ++// templates or use macros or inline functions from this file, or you compile
23.95 ++// this file and link it with other files to produce an executable, this
23.96 ++// file does not by itself cause the resulting executable to be covered by
23.97 ++// the GNU General Public License. This exception does not however
23.98 ++// invalidate any other reasons why the executable file might be covered by
23.99 ++// the GNU General Public License.
23.100 ++
23.101 ++// Written by Jakub Jelinek <jakub@redhat.com>
23.102 ++
23.103 ++#include <bits/c++config.h>
23.104 ++#include <clocale>
23.105 ++
23.106 ++#ifdef __UCLIBC_MJN3_ONLY__
23.107 ++#warning clean this up
23.108 ++#endif
23.109 ++
23.110 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.111 ++
23.112 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
23.113 ++extern "C" __typeof(strcoll_l) __strcoll_l;
23.114 ++extern "C" __typeof(strftime_l) __strftime_l;
23.115 ++extern "C" __typeof(strtod_l) __strtod_l;
23.116 ++extern "C" __typeof(strtof_l) __strtof_l;
23.117 ++extern "C" __typeof(strtold_l) __strtold_l;
23.118 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
23.119 ++extern "C" __typeof(newlocale) __newlocale;
23.120 ++extern "C" __typeof(freelocale) __freelocale;
23.121 ++extern "C" __typeof(duplocale) __duplocale;
23.122 ++extern "C" __typeof(uselocale) __uselocale;
23.123 ++
23.124 ++#ifdef _GLIBCXX_USE_WCHAR_T
23.125 ++extern "C" __typeof(iswctype_l) __iswctype_l;
23.126 ++extern "C" __typeof(towlower_l) __towlower_l;
23.127 ++extern "C" __typeof(towupper_l) __towupper_l;
23.128 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
23.129 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
23.130 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
23.131 ++extern "C" __typeof(wctype_l) __wctype_l;
23.132 ++#endif
23.133 ++
23.134 ++#endif // GLIBC 2.3 and later
23.135 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
23.136 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100
23.137 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:35.000000000 +0200
23.138 +@@ -0,0 +1,160 @@
23.139 ++// Wrapper for underlying C-language localization -*- C++ -*-
23.140 ++
23.141 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
23.142 ++//
23.143 ++// This file is part of the GNU ISO C++ Library. This library is free
23.144 ++// software; you can redistribute it and/or modify it under the
23.145 ++// terms of the GNU General Public License as published by the
23.146 ++// Free Software Foundation; either version 2, or (at your option)
23.147 ++// any later version.
23.148 ++
23.149 ++// This library is distributed in the hope that it will be useful,
23.150 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.151 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.152 ++// GNU General Public License for more details.
23.153 ++
23.154 ++// You should have received a copy of the GNU General Public License along
23.155 ++// with this library; see the file COPYING. If not, write to the Free
23.156 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.157 ++// USA.
23.158 ++
23.159 ++// As a special exception, you may use this file as part of a free software
23.160 ++// library without restriction. Specifically, if other files instantiate
23.161 ++// templates or use macros or inline functions from this file, or you compile
23.162 ++// this file and link it with other files to produce an executable, this
23.163 ++// file does not by itself cause the resulting executable to be covered by
23.164 ++// the GNU General Public License. This exception does not however
23.165 ++// invalidate any other reasons why the executable file might be covered by
23.166 ++// the GNU General Public License.
23.167 ++
23.168 ++//
23.169 ++// ISO C++ 14882: 22.8 Standard locale categories.
23.170 ++//
23.171 ++
23.172 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.173 ++
23.174 ++#include <cerrno> // For errno
23.175 ++#include <locale>
23.176 ++#include <stdexcept>
23.177 ++#include <langinfo.h>
23.178 ++#include <bits/c++locale_internal.h>
23.179 ++
23.180 ++#ifndef __UCLIBC_HAS_XLOCALE__
23.181 ++#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
23.182 ++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
23.183 ++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
23.184 ++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
23.185 ++#define __strtof_l(S, E, L) strtof((S), (E))
23.186 ++#define __strtod_l(S, E, L) strtod((S), (E))
23.187 ++#define __strtold_l(S, E, L) strtold((S), (E))
23.188 ++#warning should dummy __newlocale check for C|POSIX ?
23.189 ++#define __newlocale(a, b, c) NULL
23.190 ++#define __freelocale(a) ((void)0)
23.191 ++#define __duplocale(a) __c_locale()
23.192 ++#endif
23.193 ++
23.194 ++namespace std
23.195 ++{
23.196 ++ template<>
23.197 ++ void
23.198 ++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
23.199 ++ const __c_locale& __cloc)
23.200 ++ {
23.201 ++ if (!(__err & ios_base::failbit))
23.202 ++ {
23.203 ++ char* __sanity;
23.204 ++ errno = 0;
23.205 ++ float __f = __strtof_l(__s, &__sanity, __cloc);
23.206 ++ if (__sanity != __s && errno != ERANGE)
23.207 ++ __v = __f;
23.208 ++ else
23.209 ++ __err |= ios_base::failbit;
23.210 ++ }
23.211 ++ }
23.212 ++
23.213 ++ template<>
23.214 ++ void
23.215 ++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
23.216 ++ const __c_locale& __cloc)
23.217 ++ {
23.218 ++ if (!(__err & ios_base::failbit))
23.219 ++ {
23.220 ++ char* __sanity;
23.221 ++ errno = 0;
23.222 ++ double __d = __strtod_l(__s, &__sanity, __cloc);
23.223 ++ if (__sanity != __s && errno != ERANGE)
23.224 ++ __v = __d;
23.225 ++ else
23.226 ++ __err |= ios_base::failbit;
23.227 ++ }
23.228 ++ }
23.229 ++
23.230 ++ template<>
23.231 ++ void
23.232 ++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
23.233 ++ const __c_locale& __cloc)
23.234 ++ {
23.235 ++ if (!(__err & ios_base::failbit))
23.236 ++ {
23.237 ++ char* __sanity;
23.238 ++ errno = 0;
23.239 ++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
23.240 ++ if (__sanity != __s && errno != ERANGE)
23.241 ++ __v = __ld;
23.242 ++ else
23.243 ++ __err |= ios_base::failbit;
23.244 ++ }
23.245 ++ }
23.246 ++
23.247 ++ void
23.248 ++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
23.249 ++ __c_locale __old)
23.250 ++ {
23.251 ++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
23.252 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.253 ++ if (!__cloc)
23.254 ++ {
23.255 ++ // This named locale is not supported by the underlying OS.
23.256 ++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
23.257 ++ "name not valid"));
23.258 ++ }
23.259 ++#endif
23.260 ++ }
23.261 ++
23.262 ++ void
23.263 ++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
23.264 ++ {
23.265 ++ if (_S_get_c_locale() != __cloc)
23.266 ++ __freelocale(__cloc);
23.267 ++ }
23.268 ++
23.269 ++ __c_locale
23.270 ++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
23.271 ++ { return __duplocale(__cloc); }
23.272 ++} // namespace std
23.273 ++
23.274 ++namespace __gnu_cxx
23.275 ++{
23.276 ++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
23.277 ++ {
23.278 ++ "LC_CTYPE",
23.279 ++ "LC_NUMERIC",
23.280 ++ "LC_TIME",
23.281 ++ "LC_COLLATE",
23.282 ++ "LC_MONETARY",
23.283 ++ "LC_MESSAGES",
23.284 ++#if _GLIBCXX_NUM_CATEGORIES != 0
23.285 ++ "LC_PAPER",
23.286 ++ "LC_NAME",
23.287 ++ "LC_ADDRESS",
23.288 ++ "LC_TELEPHONE",
23.289 ++ "LC_MEASUREMENT",
23.290 ++ "LC_IDENTIFICATION"
23.291 ++#endif
23.292 ++ };
23.293 ++}
23.294 ++
23.295 ++namespace std
23.296 ++{
23.297 ++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
23.298 ++} // namespace std
23.299 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
23.300 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100
23.301 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:35.000000000 +0200
23.302 +@@ -0,0 +1,117 @@
23.303 ++// Wrapper for underlying C-language localization -*- C++ -*-
23.304 ++
23.305 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
23.306 ++//
23.307 ++// This file is part of the GNU ISO C++ Library. This library is free
23.308 ++// software; you can redistribute it and/or modify it under the
23.309 ++// terms of the GNU General Public License as published by the
23.310 ++// Free Software Foundation; either version 2, or (at your option)
23.311 ++// any later version.
23.312 ++
23.313 ++// This library is distributed in the hope that it will be useful,
23.314 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.315 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.316 ++// GNU General Public License for more details.
23.317 ++
23.318 ++// You should have received a copy of the GNU General Public License along
23.319 ++// with this library; see the file COPYING. If not, write to the Free
23.320 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.321 ++// USA.
23.322 ++
23.323 ++// As a special exception, you may use this file as part of a free software
23.324 ++// library without restriction. Specifically, if other files instantiate
23.325 ++// templates or use macros or inline functions from this file, or you compile
23.326 ++// this file and link it with other files to produce an executable, this
23.327 ++// file does not by itself cause the resulting executable to be covered by
23.328 ++// the GNU General Public License. This exception does not however
23.329 ++// invalidate any other reasons why the executable file might be covered by
23.330 ++// the GNU General Public License.
23.331 ++
23.332 ++//
23.333 ++// ISO C++ 14882: 22.8 Standard locale categories.
23.334 ++//
23.335 ++
23.336 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.337 ++
23.338 ++#ifndef _C_LOCALE_H
23.339 ++#define _C_LOCALE_H 1
23.340 ++
23.341 ++#pragma GCC system_header
23.342 ++
23.343 ++#include <cstring> // get std::strlen
23.344 ++#include <cstdio> // get std::snprintf or std::sprintf
23.345 ++#include <clocale>
23.346 ++#include <langinfo.h> // For codecvt
23.347 ++#ifdef __UCLIBC_MJN3_ONLY__
23.348 ++#warning fix this
23.349 ++#endif
23.350 ++#ifdef __UCLIBC_HAS_LOCALE__
23.351 ++#include <iconv.h> // For codecvt using iconv, iconv_t
23.352 ++#endif
23.353 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
23.354 ++#include <libintl.h> // For messages
23.355 ++#endif
23.356 ++
23.357 ++#ifdef __UCLIBC_MJN3_ONLY__
23.358 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
23.359 ++#endif
23.360 ++#define _GLIBCXX_C_LOCALE_GNU 1
23.361 ++
23.362 ++#ifdef __UCLIBC_MJN3_ONLY__
23.363 ++#warning fix categories
23.364 ++#endif
23.365 ++// #define _GLIBCXX_NUM_CATEGORIES 6
23.366 ++#define _GLIBCXX_NUM_CATEGORIES 0
23.367 ++
23.368 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.369 ++namespace __gnu_cxx
23.370 ++{
23.371 ++ extern "C" __typeof(uselocale) __uselocale;
23.372 ++}
23.373 ++#endif
23.374 ++
23.375 ++namespace std
23.376 ++{
23.377 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.378 ++ typedef __locale_t __c_locale;
23.379 ++#else
23.380 ++ typedef int* __c_locale;
23.381 ++#endif
23.382 ++
23.383 ++ // Convert numeric value of type _Tv to string and return length of
23.384 ++ // string. If snprintf is available use it, otherwise fall back to
23.385 ++ // the unsafe sprintf which, in general, can be dangerous and should
23.386 ++ // be avoided.
23.387 ++ template<typename _Tv>
23.388 ++ int
23.389 ++ __convert_from_v(char* __out,
23.390 ++ const int __size __attribute__ ((__unused__)),
23.391 ++ const char* __fmt,
23.392 ++#ifdef __UCLIBC_HAS_XCLOCALE__
23.393 ++ _Tv __v, const __c_locale& __cloc, int __prec)
23.394 ++ {
23.395 ++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
23.396 ++#else
23.397 ++ _Tv __v, const __c_locale&, int __prec)
23.398 ++ {
23.399 ++# ifdef __UCLIBC_HAS_LOCALE__
23.400 ++ char* __old = std::setlocale(LC_ALL, NULL);
23.401 ++ char* __sav = new char[std::strlen(__old) + 1];
23.402 ++ std::strcpy(__sav, __old);
23.403 ++ std::setlocale(LC_ALL, "C");
23.404 ++# endif
23.405 ++#endif
23.406 ++
23.407 ++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
23.408 ++
23.409 ++#ifdef __UCLIBC_HAS_XCLOCALE__
23.410 ++ __gnu_cxx::__uselocale(__old);
23.411 ++#elif defined __UCLIBC_HAS_LOCALE__
23.412 ++ std::setlocale(LC_ALL, __sav);
23.413 ++ delete [] __sav;
23.414 ++#endif
23.415 ++ return __ret;
23.416 ++ }
23.417 ++}
23.418 ++
23.419 ++#endif
23.420 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
23.421 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100
23.422 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-06-10 14:45:35.000000000 +0200
23.423 +@@ -0,0 +1,306 @@
23.424 ++// std::codecvt implementation details, GNU version -*- C++ -*-
23.425 ++
23.426 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
23.427 ++//
23.428 ++// This file is part of the GNU ISO C++ Library. This library is free
23.429 ++// software; you can redistribute it and/or modify it under the
23.430 ++// terms of the GNU General Public License as published by the
23.431 ++// Free Software Foundation; either version 2, or (at your option)
23.432 ++// any later version.
23.433 ++
23.434 ++// This library is distributed in the hope that it will be useful,
23.435 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.436 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.437 ++// GNU General Public License for more details.
23.438 ++
23.439 ++// You should have received a copy of the GNU General Public License along
23.440 ++// with this library; see the file COPYING. If not, write to the Free
23.441 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.442 ++// USA.
23.443 ++
23.444 ++// As a special exception, you may use this file as part of a free software
23.445 ++// library without restriction. Specifically, if other files instantiate
23.446 ++// templates or use macros or inline functions from this file, or you compile
23.447 ++// this file and link it with other files to produce an executable, this
23.448 ++// file does not by itself cause the resulting executable to be covered by
23.449 ++// the GNU General Public License. This exception does not however
23.450 ++// invalidate any other reasons why the executable file might be covered by
23.451 ++// the GNU General Public License.
23.452 ++
23.453 ++//
23.454 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
23.455 ++//
23.456 ++
23.457 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.458 ++
23.459 ++#include <locale>
23.460 ++#include <bits/c++locale_internal.h>
23.461 ++
23.462 ++namespace std
23.463 ++{
23.464 ++ // Specializations.
23.465 ++#ifdef _GLIBCXX_USE_WCHAR_T
23.466 ++ codecvt_base::result
23.467 ++ codecvt<wchar_t, char, mbstate_t>::
23.468 ++ do_out(state_type& __state, const intern_type* __from,
23.469 ++ const intern_type* __from_end, const intern_type*& __from_next,
23.470 ++ extern_type* __to, extern_type* __to_end,
23.471 ++ extern_type*& __to_next) const
23.472 ++ {
23.473 ++ result __ret = ok;
23.474 ++ state_type __tmp_state(__state);
23.475 ++
23.476 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.477 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
23.478 ++#endif
23.479 ++
23.480 ++ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
23.481 ++ // in case we fall back to wcrtomb and then continue, in a loop.
23.482 ++ // NB: wcsnrtombs is a GNU extension
23.483 ++ for (__from_next = __from, __to_next = __to;
23.484 ++ __from_next < __from_end && __to_next < __to_end
23.485 ++ && __ret == ok;)
23.486 ++ {
23.487 ++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
23.488 ++ __from_end - __from_next);
23.489 ++ if (!__from_chunk_end)
23.490 ++ __from_chunk_end = __from_end;
23.491 ++
23.492 ++ __from = __from_next;
23.493 ++ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
23.494 ++ __from_chunk_end - __from_next,
23.495 ++ __to_end - __to_next, &__state);
23.496 ++ if (__conv == static_cast<size_t>(-1))
23.497 ++ {
23.498 ++ // In case of error, in order to stop at the exact place we
23.499 ++ // have to start again from the beginning with a series of
23.500 ++ // wcrtomb.
23.501 ++ for (; __from < __from_next; ++__from)
23.502 ++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
23.503 ++ __state = __tmp_state;
23.504 ++ __ret = error;
23.505 ++ }
23.506 ++ else if (__from_next && __from_next < __from_chunk_end)
23.507 ++ {
23.508 ++ __to_next += __conv;
23.509 ++ __ret = partial;
23.510 ++ }
23.511 ++ else
23.512 ++ {
23.513 ++ __from_next = __from_chunk_end;
23.514 ++ __to_next += __conv;
23.515 ++ }
23.516 ++
23.517 ++ if (__from_next < __from_end && __ret == ok)
23.518 ++ {
23.519 ++ extern_type __buf[MB_LEN_MAX];
23.520 ++ __tmp_state = __state;
23.521 ++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
23.522 ++ if (__conv > static_cast<size_t>(__to_end - __to_next))
23.523 ++ __ret = partial;
23.524 ++ else
23.525 ++ {
23.526 ++ memcpy(__to_next, __buf, __conv);
23.527 ++ __state = __tmp_state;
23.528 ++ __to_next += __conv;
23.529 ++ ++__from_next;
23.530 ++ }
23.531 ++ }
23.532 ++ }
23.533 ++
23.534 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.535 ++ __uselocale(__old);
23.536 ++#endif
23.537 ++
23.538 ++ return __ret;
23.539 ++ }
23.540 ++
23.541 ++ codecvt_base::result
23.542 ++ codecvt<wchar_t, char, mbstate_t>::
23.543 ++ do_in(state_type& __state, const extern_type* __from,
23.544 ++ const extern_type* __from_end, const extern_type*& __from_next,
23.545 ++ intern_type* __to, intern_type* __to_end,
23.546 ++ intern_type*& __to_next) const
23.547 ++ {
23.548 ++ result __ret = ok;
23.549 ++ state_type __tmp_state(__state);
23.550 ++
23.551 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.552 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
23.553 ++#endif
23.554 ++
23.555 ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
23.556 ++ // in case we store a L'\0' and then continue, in a loop.
23.557 ++ // NB: mbsnrtowcs is a GNU extension
23.558 ++ for (__from_next = __from, __to_next = __to;
23.559 ++ __from_next < __from_end && __to_next < __to_end
23.560 ++ && __ret == ok;)
23.561 ++ {
23.562 ++ const extern_type* __from_chunk_end;
23.563 ++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
23.564 ++ __from_end
23.565 ++ - __from_next));
23.566 ++ if (!__from_chunk_end)
23.567 ++ __from_chunk_end = __from_end;
23.568 ++
23.569 ++ __from = __from_next;
23.570 ++ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
23.571 ++ __from_chunk_end - __from_next,
23.572 ++ __to_end - __to_next, &__state);
23.573 ++ if (__conv == static_cast<size_t>(-1))
23.574 ++ {
23.575 ++ // In case of error, in order to stop at the exact place we
23.576 ++ // have to start again from the beginning with a series of
23.577 ++ // mbrtowc.
23.578 ++ for (;; ++__to_next, __from += __conv)
23.579 ++ {
23.580 ++ __conv = mbrtowc(__to_next, __from, __from_end - __from,
23.581 ++ &__tmp_state);
23.582 ++ if (__conv == static_cast<size_t>(-1)
23.583 ++ || __conv == static_cast<size_t>(-2))
23.584 ++ break;
23.585 ++ }
23.586 ++ __from_next = __from;
23.587 ++ __state = __tmp_state;
23.588 ++ __ret = error;
23.589 ++ }
23.590 ++ else if (__from_next && __from_next < __from_chunk_end)
23.591 ++ {
23.592 ++ // It is unclear what to return in this case (see DR 382).
23.593 ++ __to_next += __conv;
23.594 ++ __ret = partial;
23.595 ++ }
23.596 ++ else
23.597 ++ {
23.598 ++ __from_next = __from_chunk_end;
23.599 ++ __to_next += __conv;
23.600 ++ }
23.601 ++
23.602 ++ if (__from_next < __from_end && __ret == ok)
23.603 ++ {
23.604 ++ if (__to_next < __to_end)
23.605 ++ {
23.606 ++ // XXX Probably wrong for stateful encodings
23.607 ++ __tmp_state = __state;
23.608 ++ ++__from_next;
23.609 ++ *__to_next++ = L'\0';
23.610 ++ }
23.611 ++ else
23.612 ++ __ret = partial;
23.613 ++ }
23.614 ++ }
23.615 ++
23.616 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.617 ++ __uselocale(__old);
23.618 ++#endif
23.619 ++
23.620 ++ return __ret;
23.621 ++ }
23.622 ++
23.623 ++ int
23.624 ++ codecvt<wchar_t, char, mbstate_t>::
23.625 ++ do_encoding() const throw()
23.626 ++ {
23.627 ++ // XXX This implementation assumes that the encoding is
23.628 ++ // stateless and is either single-byte or variable-width.
23.629 ++ int __ret = 0;
23.630 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.631 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
23.632 ++#endif
23.633 ++ if (MB_CUR_MAX == 1)
23.634 ++ __ret = 1;
23.635 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.636 ++ __uselocale(__old);
23.637 ++#endif
23.638 ++ return __ret;
23.639 ++ }
23.640 ++
23.641 ++ int
23.642 ++ codecvt<wchar_t, char, mbstate_t>::
23.643 ++ do_max_length() const throw()
23.644 ++ {
23.645 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.646 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
23.647 ++#endif
23.648 ++ // XXX Probably wrong for stateful encodings.
23.649 ++ int __ret = MB_CUR_MAX;
23.650 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.651 ++ __uselocale(__old);
23.652 ++#endif
23.653 ++ return __ret;
23.654 ++ }
23.655 ++
23.656 ++ int
23.657 ++ codecvt<wchar_t, char, mbstate_t>::
23.658 ++ do_length(state_type& __state, const extern_type* __from,
23.659 ++ const extern_type* __end, size_t __max) const
23.660 ++ {
23.661 ++ int __ret = 0;
23.662 ++ state_type __tmp_state(__state);
23.663 ++
23.664 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.665 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
23.666 ++#endif
23.667 ++
23.668 ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
23.669 ++ // in case we advance past it and then continue, in a loop.
23.670 ++ // NB: mbsnrtowcs is a GNU extension
23.671 ++
23.672 ++ // A dummy internal buffer is needed in order for mbsnrtocws to consider
23.673 ++ // its fourth parameter (it wouldn't with NULL as first parameter).
23.674 ++ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
23.675 ++ * __max));
23.676 ++ while (__from < __end && __max)
23.677 ++ {
23.678 ++ const extern_type* __from_chunk_end;
23.679 ++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
23.680 ++ __end
23.681 ++ - __from));
23.682 ++ if (!__from_chunk_end)
23.683 ++ __from_chunk_end = __end;
23.684 ++
23.685 ++ const extern_type* __tmp_from = __from;
23.686 ++ size_t __conv = mbsnrtowcs(__to, &__from,
23.687 ++ __from_chunk_end - __from,
23.688 ++ __max, &__state);
23.689 ++ if (__conv == static_cast<size_t>(-1))
23.690 ++ {
23.691 ++ // In case of error, in order to stop at the exact place we
23.692 ++ // have to start again from the beginning with a series of
23.693 ++ // mbrtowc.
23.694 ++ for (__from = __tmp_from;; __from += __conv)
23.695 ++ {
23.696 ++ __conv = mbrtowc(NULL, __from, __end - __from,
23.697 ++ &__tmp_state);
23.698 ++ if (__conv == static_cast<size_t>(-1)
23.699 ++ || __conv == static_cast<size_t>(-2))
23.700 ++ break;
23.701 ++ }
23.702 ++ __state = __tmp_state;
23.703 ++ __ret += __from - __tmp_from;
23.704 ++ break;
23.705 ++ }
23.706 ++ if (!__from)
23.707 ++ __from = __from_chunk_end;
23.708 ++
23.709 ++ __ret += __from - __tmp_from;
23.710 ++ __max -= __conv;
23.711 ++
23.712 ++ if (__from < __end && __max)
23.713 ++ {
23.714 ++ // XXX Probably wrong for stateful encodings
23.715 ++ __tmp_state = __state;
23.716 ++ ++__from;
23.717 ++ ++__ret;
23.718 ++ --__max;
23.719 ++ }
23.720 ++ }
23.721 ++
23.722 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.723 ++ __uselocale(__old);
23.724 ++#endif
23.725 ++
23.726 ++ return __ret;
23.727 ++ }
23.728 ++#endif
23.729 ++}
23.730 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
23.731 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100
23.732 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:35.000000000 +0200
23.733 +@@ -0,0 +1,80 @@
23.734 ++// std::collate implementation details, GNU version -*- C++ -*-
23.735 ++
23.736 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
23.737 ++//
23.738 ++// This file is part of the GNU ISO C++ Library. This library is free
23.739 ++// software; you can redistribute it and/or modify it under the
23.740 ++// terms of the GNU General Public License as published by the
23.741 ++// Free Software Foundation; either version 2, or (at your option)
23.742 ++// any later version.
23.743 ++
23.744 ++// This library is distributed in the hope that it will be useful,
23.745 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.746 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.747 ++// GNU General Public License for more details.
23.748 ++
23.749 ++// You should have received a copy of the GNU General Public License along
23.750 ++// with this library; see the file COPYING. If not, write to the Free
23.751 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.752 ++// USA.
23.753 ++
23.754 ++// As a special exception, you may use this file as part of a free software
23.755 ++// library without restriction. Specifically, if other files instantiate
23.756 ++// templates or use macros or inline functions from this file, or you compile
23.757 ++// this file and link it with other files to produce an executable, this
23.758 ++// file does not by itself cause the resulting executable to be covered by
23.759 ++// the GNU General Public License. This exception does not however
23.760 ++// invalidate any other reasons why the executable file might be covered by
23.761 ++// the GNU General Public License.
23.762 ++
23.763 ++//
23.764 ++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
23.765 ++//
23.766 ++
23.767 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.768 ++
23.769 ++#include <locale>
23.770 ++#include <bits/c++locale_internal.h>
23.771 ++
23.772 ++#ifndef __UCLIBC_HAS_XLOCALE__
23.773 ++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
23.774 ++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
23.775 ++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
23.776 ++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
23.777 ++#endif
23.778 ++
23.779 ++namespace std
23.780 ++{
23.781 ++ // These are basically extensions to char_traits, and perhaps should
23.782 ++ // be put there instead of here.
23.783 ++ template<>
23.784 ++ int
23.785 ++ collate<char>::_M_compare(const char* __one, const char* __two) const
23.786 ++ {
23.787 ++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
23.788 ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
23.789 ++ }
23.790 ++
23.791 ++ template<>
23.792 ++ size_t
23.793 ++ collate<char>::_M_transform(char* __to, const char* __from,
23.794 ++ size_t __n) const
23.795 ++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
23.796 ++
23.797 ++#ifdef _GLIBCXX_USE_WCHAR_T
23.798 ++ template<>
23.799 ++ int
23.800 ++ collate<wchar_t>::_M_compare(const wchar_t* __one,
23.801 ++ const wchar_t* __two) const
23.802 ++ {
23.803 ++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
23.804 ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
23.805 ++ }
23.806 ++
23.807 ++ template<>
23.808 ++ size_t
23.809 ++ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
23.810 ++ size_t __n) const
23.811 ++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
23.812 ++#endif
23.813 ++}
23.814 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
23.815 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100
23.816 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:35.000000000 +0200
23.817 +@@ -0,0 +1,300 @@
23.818 ++// std::ctype implementation details, GNU version -*- C++ -*-
23.819 ++
23.820 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
23.821 ++//
23.822 ++// This file is part of the GNU ISO C++ Library. This library is free
23.823 ++// software; you can redistribute it and/or modify it under the
23.824 ++// terms of the GNU General Public License as published by the
23.825 ++// Free Software Foundation; either version 2, or (at your option)
23.826 ++// any later version.
23.827 ++
23.828 ++// This library is distributed in the hope that it will be useful,
23.829 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.830 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.831 ++// GNU General Public License for more details.
23.832 ++
23.833 ++// You should have received a copy of the GNU General Public License along
23.834 ++// with this library; see the file COPYING. If not, write to the Free
23.835 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.836 ++// USA.
23.837 ++
23.838 ++// As a special exception, you may use this file as part of a free software
23.839 ++// library without restriction. Specifically, if other files instantiate
23.840 ++// templates or use macros or inline functions from this file, or you compile
23.841 ++// this file and link it with other files to produce an executable, this
23.842 ++// file does not by itself cause the resulting executable to be covered by
23.843 ++// the GNU General Public License. This exception does not however
23.844 ++// invalidate any other reasons why the executable file might be covered by
23.845 ++// the GNU General Public License.
23.846 ++
23.847 ++//
23.848 ++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
23.849 ++//
23.850 ++
23.851 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.852 ++
23.853 ++#define _LIBC
23.854 ++#include <locale>
23.855 ++#undef _LIBC
23.856 ++#include <bits/c++locale_internal.h>
23.857 ++
23.858 ++#ifndef __UCLIBC_HAS_XLOCALE__
23.859 ++#define __wctype_l(S, L) wctype((S))
23.860 ++#define __towupper_l(C, L) towupper((C))
23.861 ++#define __towlower_l(C, L) towlower((C))
23.862 ++#define __iswctype_l(C, M, L) iswctype((C), (M))
23.863 ++#endif
23.864 ++
23.865 ++namespace std
23.866 ++{
23.867 ++ // NB: The other ctype<char> specializations are in src/locale.cc and
23.868 ++ // various /config/os/* files.
23.869 ++ template<>
23.870 ++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
23.871 ++ : ctype<char>(0, false, __refs)
23.872 ++ {
23.873 ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
23.874 ++ {
23.875 ++ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
23.876 ++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
23.877 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.878 ++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
23.879 ++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
23.880 ++ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
23.881 ++#endif
23.882 ++ }
23.883 ++ }
23.884 ++
23.885 ++#ifdef _GLIBCXX_USE_WCHAR_T
23.886 ++ ctype<wchar_t>::__wmask_type
23.887 ++ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
23.888 ++ {
23.889 ++ __wmask_type __ret;
23.890 ++ switch (__m)
23.891 ++ {
23.892 ++ case space:
23.893 ++ __ret = __wctype_l("space", _M_c_locale_ctype);
23.894 ++ break;
23.895 ++ case print:
23.896 ++ __ret = __wctype_l("print", _M_c_locale_ctype);
23.897 ++ break;
23.898 ++ case cntrl:
23.899 ++ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
23.900 ++ break;
23.901 ++ case upper:
23.902 ++ __ret = __wctype_l("upper", _M_c_locale_ctype);
23.903 ++ break;
23.904 ++ case lower:
23.905 ++ __ret = __wctype_l("lower", _M_c_locale_ctype);
23.906 ++ break;
23.907 ++ case alpha:
23.908 ++ __ret = __wctype_l("alpha", _M_c_locale_ctype);
23.909 ++ break;
23.910 ++ case digit:
23.911 ++ __ret = __wctype_l("digit", _M_c_locale_ctype);
23.912 ++ break;
23.913 ++ case punct:
23.914 ++ __ret = __wctype_l("punct", _M_c_locale_ctype);
23.915 ++ break;
23.916 ++ case xdigit:
23.917 ++ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
23.918 ++ break;
23.919 ++ case alnum:
23.920 ++ __ret = __wctype_l("alnum", _M_c_locale_ctype);
23.921 ++ break;
23.922 ++ case graph:
23.923 ++ __ret = __wctype_l("graph", _M_c_locale_ctype);
23.924 ++ break;
23.925 ++ default:
23.926 ++ __ret = __wmask_type();
23.927 ++ }
23.928 ++ return __ret;
23.929 ++ }
23.930 ++
23.931 ++ wchar_t
23.932 ++ ctype<wchar_t>::do_toupper(wchar_t __c) const
23.933 ++ { return __towupper_l(__c, _M_c_locale_ctype); }
23.934 ++
23.935 ++ const wchar_t*
23.936 ++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
23.937 ++ {
23.938 ++ while (__lo < __hi)
23.939 ++ {
23.940 ++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
23.941 ++ ++__lo;
23.942 ++ }
23.943 ++ return __hi;
23.944 ++ }
23.945 ++
23.946 ++ wchar_t
23.947 ++ ctype<wchar_t>::do_tolower(wchar_t __c) const
23.948 ++ { return __towlower_l(__c, _M_c_locale_ctype); }
23.949 ++
23.950 ++ const wchar_t*
23.951 ++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
23.952 ++ {
23.953 ++ while (__lo < __hi)
23.954 ++ {
23.955 ++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
23.956 ++ ++__lo;
23.957 ++ }
23.958 ++ return __hi;
23.959 ++ }
23.960 ++
23.961 ++ bool
23.962 ++ ctype<wchar_t>::
23.963 ++ do_is(mask __m, wchar_t __c) const
23.964 ++ {
23.965 ++ // Highest bitmask in ctype_base == 10, but extra in "C"
23.966 ++ // library for blank.
23.967 ++ bool __ret = false;
23.968 ++ const size_t __bitmasksize = 11;
23.969 ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
23.970 ++ if (__m & _M_bit[__bitcur]
23.971 ++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
23.972 ++ {
23.973 ++ __ret = true;
23.974 ++ break;
23.975 ++ }
23.976 ++ return __ret;
23.977 ++ }
23.978 ++
23.979 ++ const wchar_t*
23.980 ++ ctype<wchar_t>::
23.981 ++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
23.982 ++ {
23.983 ++ for (; __lo < __hi; ++__vec, ++__lo)
23.984 ++ {
23.985 ++ // Highest bitmask in ctype_base == 10, but extra in "C"
23.986 ++ // library for blank.
23.987 ++ const size_t __bitmasksize = 11;
23.988 ++ mask __m = 0;
23.989 ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
23.990 ++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
23.991 ++ __m |= _M_bit[__bitcur];
23.992 ++ *__vec = __m;
23.993 ++ }
23.994 ++ return __hi;
23.995 ++ }
23.996 ++
23.997 ++ const wchar_t*
23.998 ++ ctype<wchar_t>::
23.999 ++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
23.1000 ++ {
23.1001 ++ while (__lo < __hi && !this->do_is(__m, *__lo))
23.1002 ++ ++__lo;
23.1003 ++ return __lo;
23.1004 ++ }
23.1005 ++
23.1006 ++ const wchar_t*
23.1007 ++ ctype<wchar_t>::
23.1008 ++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
23.1009 ++ {
23.1010 ++ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
23.1011 ++ ++__lo;
23.1012 ++ return __lo;
23.1013 ++ }
23.1014 ++
23.1015 ++ wchar_t
23.1016 ++ ctype<wchar_t>::
23.1017 ++ do_widen(char __c) const
23.1018 ++ { return _M_widen[static_cast<unsigned char>(__c)]; }
23.1019 ++
23.1020 ++ const char*
23.1021 ++ ctype<wchar_t>::
23.1022 ++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
23.1023 ++ {
23.1024 ++ while (__lo < __hi)
23.1025 ++ {
23.1026 ++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
23.1027 ++ ++__lo;
23.1028 ++ ++__dest;
23.1029 ++ }
23.1030 ++ return __hi;
23.1031 ++ }
23.1032 ++
23.1033 ++ char
23.1034 ++ ctype<wchar_t>::
23.1035 ++ do_narrow(wchar_t __wc, char __dfault) const
23.1036 ++ {
23.1037 ++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
23.1038 ++ return _M_narrow[__wc];
23.1039 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1040 ++ __c_locale __old = __uselocale(_M_c_locale_ctype);
23.1041 ++#endif
23.1042 ++ const int __c = wctob(__wc);
23.1043 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1044 ++ __uselocale(__old);
23.1045 ++#endif
23.1046 ++ return (__c == EOF ? __dfault : static_cast<char>(__c));
23.1047 ++ }
23.1048 ++
23.1049 ++ const wchar_t*
23.1050 ++ ctype<wchar_t>::
23.1051 ++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
23.1052 ++ char* __dest) const
23.1053 ++ {
23.1054 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1055 ++ __c_locale __old = __uselocale(_M_c_locale_ctype);
23.1056 ++#endif
23.1057 ++ if (_M_narrow_ok)
23.1058 ++ while (__lo < __hi)
23.1059 ++ {
23.1060 ++ if (*__lo >= 0 && *__lo < 128)
23.1061 ++ *__dest = _M_narrow[*__lo];
23.1062 ++ else
23.1063 ++ {
23.1064 ++ const int __c = wctob(*__lo);
23.1065 ++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
23.1066 ++ }
23.1067 ++ ++__lo;
23.1068 ++ ++__dest;
23.1069 ++ }
23.1070 ++ else
23.1071 ++ while (__lo < __hi)
23.1072 ++ {
23.1073 ++ const int __c = wctob(*__lo);
23.1074 ++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
23.1075 ++ ++__lo;
23.1076 ++ ++__dest;
23.1077 ++ }
23.1078 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1079 ++ __uselocale(__old);
23.1080 ++#endif
23.1081 ++ return __hi;
23.1082 ++ }
23.1083 ++
23.1084 ++ void
23.1085 ++ ctype<wchar_t>::_M_initialize_ctype()
23.1086 ++ {
23.1087 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1088 ++ __c_locale __old = __uselocale(_M_c_locale_ctype);
23.1089 ++#endif
23.1090 ++ wint_t __i;
23.1091 ++ for (__i = 0; __i < 128; ++__i)
23.1092 ++ {
23.1093 ++ const int __c = wctob(__i);
23.1094 ++ if (__c == EOF)
23.1095 ++ break;
23.1096 ++ else
23.1097 ++ _M_narrow[__i] = static_cast<char>(__c);
23.1098 ++ }
23.1099 ++ if (__i == 128)
23.1100 ++ _M_narrow_ok = true;
23.1101 ++ else
23.1102 ++ _M_narrow_ok = false;
23.1103 ++ for (size_t __j = 0;
23.1104 ++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
23.1105 ++ _M_widen[__j] = btowc(__j);
23.1106 ++
23.1107 ++ for (size_t __k = 0; __k <= 11; ++__k)
23.1108 ++ {
23.1109 ++ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
23.1110 ++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
23.1111 ++ }
23.1112 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1113 ++ __uselocale(__old);
23.1114 ++#endif
23.1115 ++ }
23.1116 ++#endif // _GLIBCXX_USE_WCHAR_T
23.1117 ++}
23.1118 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
23.1119 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100
23.1120 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:35.000000000 +0200
23.1121 +@@ -0,0 +1,100 @@
23.1122 ++// std::messages implementation details, GNU version -*- C++ -*-
23.1123 ++
23.1124 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
23.1125 ++//
23.1126 ++// This file is part of the GNU ISO C++ Library. This library is free
23.1127 ++// software; you can redistribute it and/or modify it under the
23.1128 ++// terms of the GNU General Public License as published by the
23.1129 ++// Free Software Foundation; either version 2, or (at your option)
23.1130 ++// any later version.
23.1131 ++
23.1132 ++// This library is distributed in the hope that it will be useful,
23.1133 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.1134 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.1135 ++// GNU General Public License for more details.
23.1136 ++
23.1137 ++// You should have received a copy of the GNU General Public License along
23.1138 ++// with this library; see the file COPYING. If not, write to the Free
23.1139 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.1140 ++// USA.
23.1141 ++
23.1142 ++// As a special exception, you may use this file as part of a free software
23.1143 ++// library without restriction. Specifically, if other files instantiate
23.1144 ++// templates or use macros or inline functions from this file, or you compile
23.1145 ++// this file and link it with other files to produce an executable, this
23.1146 ++// file does not by itself cause the resulting executable to be covered by
23.1147 ++// the GNU General Public License. This exception does not however
23.1148 ++// invalidate any other reasons why the executable file might be covered by
23.1149 ++// the GNU General Public License.
23.1150 ++
23.1151 ++//
23.1152 ++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
23.1153 ++//
23.1154 ++
23.1155 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.1156 ++
23.1157 ++#include <locale>
23.1158 ++#include <bits/c++locale_internal.h>
23.1159 ++
23.1160 ++#ifdef __UCLIBC_MJN3_ONLY__
23.1161 ++#warning fix gettext stuff
23.1162 ++#endif
23.1163 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
23.1164 ++extern "C" char *__dcgettext(const char *domainname,
23.1165 ++ const char *msgid, int category);
23.1166 ++#undef gettext
23.1167 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
23.1168 ++#else
23.1169 ++#undef gettext
23.1170 ++#define gettext(msgid) (msgid)
23.1171 ++#endif
23.1172 ++
23.1173 ++namespace std
23.1174 ++{
23.1175 ++ // Specializations.
23.1176 ++ template<>
23.1177 ++ string
23.1178 ++ messages<char>::do_get(catalog, int, int, const string& __dfault) const
23.1179 ++ {
23.1180 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1181 ++ __c_locale __old = __uselocale(_M_c_locale_messages);
23.1182 ++ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
23.1183 ++ __uselocale(__old);
23.1184 ++ return string(__msg);
23.1185 ++#elif defined __UCLIBC_HAS_LOCALE__
23.1186 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
23.1187 ++ setlocale(LC_ALL, _M_name_messages);
23.1188 ++ const char* __msg = gettext(__dfault.c_str());
23.1189 ++ setlocale(LC_ALL, __old);
23.1190 ++ free(__old);
23.1191 ++ return string(__msg);
23.1192 ++#else
23.1193 ++ const char* __msg = gettext(__dfault.c_str());
23.1194 ++ return string(__msg);
23.1195 ++#endif
23.1196 ++ }
23.1197 ++
23.1198 ++#ifdef _GLIBCXX_USE_WCHAR_T
23.1199 ++ template<>
23.1200 ++ wstring
23.1201 ++ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
23.1202 ++ {
23.1203 ++# ifdef __UCLIBC_HAS_XLOCALE__
23.1204 ++ __c_locale __old = __uselocale(_M_c_locale_messages);
23.1205 ++ char* __msg = gettext(_M_convert_to_char(__dfault));
23.1206 ++ __uselocale(__old);
23.1207 ++ return _M_convert_from_char(__msg);
23.1208 ++# elif defined __UCLIBC_HAS_LOCALE__
23.1209 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
23.1210 ++ setlocale(LC_ALL, _M_name_messages);
23.1211 ++ char* __msg = gettext(_M_convert_to_char(__dfault));
23.1212 ++ setlocale(LC_ALL, __old);
23.1213 ++ free(__old);
23.1214 ++ return _M_convert_from_char(__msg);
23.1215 ++# else
23.1216 ++ char* __msg = gettext(_M_convert_to_char(__dfault));
23.1217 ++ return _M_convert_from_char(__msg);
23.1218 ++# endif
23.1219 ++ }
23.1220 ++#endif
23.1221 ++}
23.1222 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
23.1223 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100
23.1224 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:35.000000000 +0200
23.1225 +@@ -0,0 +1,118 @@
23.1226 ++// std::messages implementation details, GNU version -*- C++ -*-
23.1227 ++
23.1228 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
23.1229 ++//
23.1230 ++// This file is part of the GNU ISO C++ Library. This library is free
23.1231 ++// software; you can redistribute it and/or modify it under the
23.1232 ++// terms of the GNU General Public License as published by the
23.1233 ++// Free Software Foundation; either version 2, or (at your option)
23.1234 ++// any later version.
23.1235 ++
23.1236 ++// This library is distributed in the hope that it will be useful,
23.1237 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.1238 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.1239 ++// GNU General Public License for more details.
23.1240 ++
23.1241 ++// You should have received a copy of the GNU General Public License along
23.1242 ++// with this library; see the file COPYING. If not, write to the Free
23.1243 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.1244 ++// USA.
23.1245 ++
23.1246 ++// As a special exception, you may use this file as part of a free software
23.1247 ++// library without restriction. Specifically, if other files instantiate
23.1248 ++// templates or use macros or inline functions from this file, or you compile
23.1249 ++// this file and link it with other files to produce an executable, this
23.1250 ++// file does not by itself cause the resulting executable to be covered by
23.1251 ++// the GNU General Public License. This exception does not however
23.1252 ++// invalidate any other reasons why the executable file might be covered by
23.1253 ++// the GNU General Public License.
23.1254 ++
23.1255 ++//
23.1256 ++// ISO C++ 14882: 22.2.7.1.2 messages functions
23.1257 ++//
23.1258 ++
23.1259 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.1260 ++
23.1261 ++#ifdef __UCLIBC_MJN3_ONLY__
23.1262 ++#warning fix prototypes for *textdomain funcs
23.1263 ++#endif
23.1264 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
23.1265 ++extern "C" char *__textdomain(const char *domainname);
23.1266 ++extern "C" char *__bindtextdomain(const char *domainname,
23.1267 ++ const char *dirname);
23.1268 ++#else
23.1269 ++#undef __textdomain
23.1270 ++#undef __bindtextdomain
23.1271 ++#define __textdomain(D) ((void)0)
23.1272 ++#define __bindtextdomain(D,P) ((void)0)
23.1273 ++#endif
23.1274 ++
23.1275 ++ // Non-virtual member functions.
23.1276 ++ template<typename _CharT>
23.1277 ++ messages<_CharT>::messages(size_t __refs)
23.1278 ++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
23.1279 ++ _M_name_messages(_S_get_c_name())
23.1280 ++ { }
23.1281 ++
23.1282 ++ template<typename _CharT>
23.1283 ++ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
23.1284 ++ size_t __refs)
23.1285 ++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
23.1286 ++ _M_name_messages(__s)
23.1287 ++ {
23.1288 ++ char* __tmp = new char[std::strlen(__s) + 1];
23.1289 ++ std::strcpy(__tmp, __s);
23.1290 ++ _M_name_messages = __tmp;
23.1291 ++ }
23.1292 ++
23.1293 ++ template<typename _CharT>
23.1294 ++ typename messages<_CharT>::catalog
23.1295 ++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
23.1296 ++ const char* __dir) const
23.1297 ++ {
23.1298 ++ __bindtextdomain(__s.c_str(), __dir);
23.1299 ++ return this->do_open(__s, __loc);
23.1300 ++ }
23.1301 ++
23.1302 ++ // Virtual member functions.
23.1303 ++ template<typename _CharT>
23.1304 ++ messages<_CharT>::~messages()
23.1305 ++ {
23.1306 ++ if (_M_name_messages != _S_get_c_name())
23.1307 ++ delete [] _M_name_messages;
23.1308 ++ _S_destroy_c_locale(_M_c_locale_messages);
23.1309 ++ }
23.1310 ++
23.1311 ++ template<typename _CharT>
23.1312 ++ typename messages<_CharT>::catalog
23.1313 ++ messages<_CharT>::do_open(const basic_string<char>& __s,
23.1314 ++ const locale&) const
23.1315 ++ {
23.1316 ++ // No error checking is done, assume the catalog exists and can
23.1317 ++ // be used.
23.1318 ++ __textdomain(__s.c_str());
23.1319 ++ return 0;
23.1320 ++ }
23.1321 ++
23.1322 ++ template<typename _CharT>
23.1323 ++ void
23.1324 ++ messages<_CharT>::do_close(catalog) const
23.1325 ++ { }
23.1326 ++
23.1327 ++ // messages_byname
23.1328 ++ template<typename _CharT>
23.1329 ++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
23.1330 ++ : messages<_CharT>(__refs)
23.1331 ++ {
23.1332 ++ if (this->_M_name_messages != locale::facet::_S_get_c_name())
23.1333 ++ delete [] this->_M_name_messages;
23.1334 ++ char* __tmp = new char[std::strlen(__s) + 1];
23.1335 ++ std::strcpy(__tmp, __s);
23.1336 ++ this->_M_name_messages = __tmp;
23.1337 ++
23.1338 ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
23.1339 ++ {
23.1340 ++ this->_S_destroy_c_locale(this->_M_c_locale_messages);
23.1341 ++ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
23.1342 ++ }
23.1343 ++ }
23.1344 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
23.1345 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100
23.1346 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:35.000000000 +0200
23.1347 +@@ -0,0 +1,692 @@
23.1348 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
23.1349 ++
23.1350 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
23.1351 ++//
23.1352 ++// This file is part of the GNU ISO C++ Library. This library is free
23.1353 ++// software; you can redistribute it and/or modify it under the
23.1354 ++// terms of the GNU General Public License as published by the
23.1355 ++// Free Software Foundation; either version 2, or (at your option)
23.1356 ++// any later version.
23.1357 ++
23.1358 ++// This library is distributed in the hope that it will be useful,
23.1359 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.1360 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.1361 ++// GNU General Public License for more details.
23.1362 ++
23.1363 ++// You should have received a copy of the GNU General Public License along
23.1364 ++// with this library; see the file COPYING. If not, write to the Free
23.1365 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.1366 ++// USA.
23.1367 ++
23.1368 ++// As a special exception, you may use this file as part of a free software
23.1369 ++// library without restriction. Specifically, if other files instantiate
23.1370 ++// templates or use macros or inline functions from this file, or you compile
23.1371 ++// this file and link it with other files to produce an executable, this
23.1372 ++// file does not by itself cause the resulting executable to be covered by
23.1373 ++// the GNU General Public License. This exception does not however
23.1374 ++// invalidate any other reasons why the executable file might be covered by
23.1375 ++// the GNU General Public License.
23.1376 ++
23.1377 ++//
23.1378 ++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
23.1379 ++//
23.1380 ++
23.1381 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.1382 ++
23.1383 ++#define _LIBC
23.1384 ++#include <locale>
23.1385 ++#undef _LIBC
23.1386 ++#include <bits/c++locale_internal.h>
23.1387 ++
23.1388 ++#ifdef __UCLIBC_MJN3_ONLY__
23.1389 ++#warning optimize this for uclibc
23.1390 ++#warning tailor for stub locale support
23.1391 ++#endif
23.1392 ++
23.1393 ++#ifndef __UCLIBC_HAS_XLOCALE__
23.1394 ++#define __nl_langinfo_l(N, L) nl_langinfo((N))
23.1395 ++#endif
23.1396 ++
23.1397 ++namespace std
23.1398 ++{
23.1399 ++ // Construct and return valid pattern consisting of some combination of:
23.1400 ++ // space none symbol sign value
23.1401 ++ money_base::pattern
23.1402 ++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
23.1403 ++ {
23.1404 ++ pattern __ret;
23.1405 ++
23.1406 ++ // This insanely complicated routine attempts to construct a valid
23.1407 ++ // pattern for use with monyepunct. A couple of invariants:
23.1408 ++
23.1409 ++ // if (__precedes) symbol -> value
23.1410 ++ // else value -> symbol
23.1411 ++
23.1412 ++ // if (__space) space
23.1413 ++ // else none
23.1414 ++
23.1415 ++ // none == never first
23.1416 ++ // space never first or last
23.1417 ++
23.1418 ++ // Any elegant implementations of this are welcome.
23.1419 ++ switch (__posn)
23.1420 ++ {
23.1421 ++ case 0:
23.1422 ++ case 1:
23.1423 ++ // 1 The sign precedes the value and symbol.
23.1424 ++ __ret.field[0] = sign;
23.1425 ++ if (__space)
23.1426 ++ {
23.1427 ++ // Pattern starts with sign.
23.1428 ++ if (__precedes)
23.1429 ++ {
23.1430 ++ __ret.field[1] = symbol;
23.1431 ++ __ret.field[3] = value;
23.1432 ++ }
23.1433 ++ else
23.1434 ++ {
23.1435 ++ __ret.field[1] = value;
23.1436 ++ __ret.field[3] = symbol;
23.1437 ++ }
23.1438 ++ __ret.field[2] = space;
23.1439 ++ }
23.1440 ++ else
23.1441 ++ {
23.1442 ++ // Pattern starts with sign and ends with none.
23.1443 ++ if (__precedes)
23.1444 ++ {
23.1445 ++ __ret.field[1] = symbol;
23.1446 ++ __ret.field[2] = value;
23.1447 ++ }
23.1448 ++ else
23.1449 ++ {
23.1450 ++ __ret.field[1] = value;
23.1451 ++ __ret.field[2] = symbol;
23.1452 ++ }
23.1453 ++ __ret.field[3] = none;
23.1454 ++ }
23.1455 ++ break;
23.1456 ++ case 2:
23.1457 ++ // 2 The sign follows the value and symbol.
23.1458 ++ if (__space)
23.1459 ++ {
23.1460 ++ // Pattern either ends with sign.
23.1461 ++ if (__precedes)
23.1462 ++ {
23.1463 ++ __ret.field[0] = symbol;
23.1464 ++ __ret.field[2] = value;
23.1465 ++ }
23.1466 ++ else
23.1467 ++ {
23.1468 ++ __ret.field[0] = value;
23.1469 ++ __ret.field[2] = symbol;
23.1470 ++ }
23.1471 ++ __ret.field[1] = space;
23.1472 ++ __ret.field[3] = sign;
23.1473 ++ }
23.1474 ++ else
23.1475 ++ {
23.1476 ++ // Pattern ends with sign then none.
23.1477 ++ if (__precedes)
23.1478 ++ {
23.1479 ++ __ret.field[0] = symbol;
23.1480 ++ __ret.field[1] = value;
23.1481 ++ }
23.1482 ++ else
23.1483 ++ {
23.1484 ++ __ret.field[0] = value;
23.1485 ++ __ret.field[1] = symbol;
23.1486 ++ }
23.1487 ++ __ret.field[2] = sign;
23.1488 ++ __ret.field[3] = none;
23.1489 ++ }
23.1490 ++ break;
23.1491 ++ case 3:
23.1492 ++ // 3 The sign immediately precedes the symbol.
23.1493 ++ if (__precedes)
23.1494 ++ {
23.1495 ++ __ret.field[0] = sign;
23.1496 ++ __ret.field[1] = symbol;
23.1497 ++ if (__space)
23.1498 ++ {
23.1499 ++ __ret.field[2] = space;
23.1500 ++ __ret.field[3] = value;
23.1501 ++ }
23.1502 ++ else
23.1503 ++ {
23.1504 ++ __ret.field[2] = value;
23.1505 ++ __ret.field[3] = none;
23.1506 ++ }
23.1507 ++ }
23.1508 ++ else
23.1509 ++ {
23.1510 ++ __ret.field[0] = value;
23.1511 ++ if (__space)
23.1512 ++ {
23.1513 ++ __ret.field[1] = space;
23.1514 ++ __ret.field[2] = sign;
23.1515 ++ __ret.field[3] = symbol;
23.1516 ++ }
23.1517 ++ else
23.1518 ++ {
23.1519 ++ __ret.field[1] = sign;
23.1520 ++ __ret.field[2] = symbol;
23.1521 ++ __ret.field[3] = none;
23.1522 ++ }
23.1523 ++ }
23.1524 ++ break;
23.1525 ++ case 4:
23.1526 ++ // 4 The sign immediately follows the symbol.
23.1527 ++ if (__precedes)
23.1528 ++ {
23.1529 ++ __ret.field[0] = symbol;
23.1530 ++ __ret.field[1] = sign;
23.1531 ++ if (__space)
23.1532 ++ {
23.1533 ++ __ret.field[2] = space;
23.1534 ++ __ret.field[3] = value;
23.1535 ++ }
23.1536 ++ else
23.1537 ++ {
23.1538 ++ __ret.field[2] = value;
23.1539 ++ __ret.field[3] = none;
23.1540 ++ }
23.1541 ++ }
23.1542 ++ else
23.1543 ++ {
23.1544 ++ __ret.field[0] = value;
23.1545 ++ if (__space)
23.1546 ++ {
23.1547 ++ __ret.field[1] = space;
23.1548 ++ __ret.field[2] = symbol;
23.1549 ++ __ret.field[3] = sign;
23.1550 ++ }
23.1551 ++ else
23.1552 ++ {
23.1553 ++ __ret.field[1] = symbol;
23.1554 ++ __ret.field[2] = sign;
23.1555 ++ __ret.field[3] = none;
23.1556 ++ }
23.1557 ++ }
23.1558 ++ break;
23.1559 ++ default:
23.1560 ++ ;
23.1561 ++ }
23.1562 ++ return __ret;
23.1563 ++ }
23.1564 ++
23.1565 ++ template<>
23.1566 ++ void
23.1567 ++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
23.1568 ++ const char*)
23.1569 ++ {
23.1570 ++ if (!_M_data)
23.1571 ++ _M_data = new __moneypunct_cache<char, true>;
23.1572 ++
23.1573 ++ if (!__cloc)
23.1574 ++ {
23.1575 ++ // "C" locale
23.1576 ++ _M_data->_M_decimal_point = '.';
23.1577 ++ _M_data->_M_thousands_sep = ',';
23.1578 ++ _M_data->_M_grouping = "";
23.1579 ++ _M_data->_M_grouping_size = 0;
23.1580 ++ _M_data->_M_curr_symbol = "";
23.1581 ++ _M_data->_M_curr_symbol_size = 0;
23.1582 ++ _M_data->_M_positive_sign = "";
23.1583 ++ _M_data->_M_positive_sign_size = 0;
23.1584 ++ _M_data->_M_negative_sign = "";
23.1585 ++ _M_data->_M_negative_sign_size = 0;
23.1586 ++ _M_data->_M_frac_digits = 0;
23.1587 ++ _M_data->_M_pos_format = money_base::_S_default_pattern;
23.1588 ++ _M_data->_M_neg_format = money_base::_S_default_pattern;
23.1589 ++
23.1590 ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
23.1591 ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
23.1592 ++ }
23.1593 ++ else
23.1594 ++ {
23.1595 ++ // Named locale.
23.1596 ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
23.1597 ++ __cloc));
23.1598 ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
23.1599 ++ __cloc));
23.1600 ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
23.1601 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
23.1602 ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
23.1603 ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
23.1604 ++
23.1605 ++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
23.1606 ++ if (!__nposn)
23.1607 ++ _M_data->_M_negative_sign = "()";
23.1608 ++ else
23.1609 ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
23.1610 ++ __cloc);
23.1611 ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
23.1612 ++
23.1613 ++ // _Intl == true
23.1614 ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
23.1615 ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
23.1616 ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
23.1617 ++ __cloc));
23.1618 ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
23.1619 ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
23.1620 ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
23.1621 ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
23.1622 ++ __pposn);
23.1623 ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
23.1624 ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
23.1625 ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
23.1626 ++ __nposn);
23.1627 ++ }
23.1628 ++ }
23.1629 ++
23.1630 ++ template<>
23.1631 ++ void
23.1632 ++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
23.1633 ++ const char*)
23.1634 ++ {
23.1635 ++ if (!_M_data)
23.1636 ++ _M_data = new __moneypunct_cache<char, false>;
23.1637 ++
23.1638 ++ if (!__cloc)
23.1639 ++ {
23.1640 ++ // "C" locale
23.1641 ++ _M_data->_M_decimal_point = '.';
23.1642 ++ _M_data->_M_thousands_sep = ',';
23.1643 ++ _M_data->_M_grouping = "";
23.1644 ++ _M_data->_M_grouping_size = 0;
23.1645 ++ _M_data->_M_curr_symbol = "";
23.1646 ++ _M_data->_M_curr_symbol_size = 0;
23.1647 ++ _M_data->_M_positive_sign = "";
23.1648 ++ _M_data->_M_positive_sign_size = 0;
23.1649 ++ _M_data->_M_negative_sign = "";
23.1650 ++ _M_data->_M_negative_sign_size = 0;
23.1651 ++ _M_data->_M_frac_digits = 0;
23.1652 ++ _M_data->_M_pos_format = money_base::_S_default_pattern;
23.1653 ++ _M_data->_M_neg_format = money_base::_S_default_pattern;
23.1654 ++
23.1655 ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
23.1656 ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
23.1657 ++ }
23.1658 ++ else
23.1659 ++ {
23.1660 ++ // Named locale.
23.1661 ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
23.1662 ++ __cloc));
23.1663 ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
23.1664 ++ __cloc));
23.1665 ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
23.1666 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
23.1667 ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
23.1668 ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
23.1669 ++
23.1670 ++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
23.1671 ++ if (!__nposn)
23.1672 ++ _M_data->_M_negative_sign = "()";
23.1673 ++ else
23.1674 ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
23.1675 ++ __cloc);
23.1676 ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
23.1677 ++
23.1678 ++ // _Intl == false
23.1679 ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
23.1680 ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
23.1681 ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
23.1682 ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
23.1683 ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
23.1684 ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
23.1685 ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
23.1686 ++ __pposn);
23.1687 ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
23.1688 ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
23.1689 ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
23.1690 ++ __nposn);
23.1691 ++ }
23.1692 ++ }
23.1693 ++
23.1694 ++ template<>
23.1695 ++ moneypunct<char, true>::~moneypunct()
23.1696 ++ { delete _M_data; }
23.1697 ++
23.1698 ++ template<>
23.1699 ++ moneypunct<char, false>::~moneypunct()
23.1700 ++ { delete _M_data; }
23.1701 ++
23.1702 ++#ifdef _GLIBCXX_USE_WCHAR_T
23.1703 ++ template<>
23.1704 ++ void
23.1705 ++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
23.1706 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1707 ++ const char*)
23.1708 ++#else
23.1709 ++ const char* __name)
23.1710 ++#endif
23.1711 ++ {
23.1712 ++ if (!_M_data)
23.1713 ++ _M_data = new __moneypunct_cache<wchar_t, true>;
23.1714 ++
23.1715 ++ if (!__cloc)
23.1716 ++ {
23.1717 ++ // "C" locale
23.1718 ++ _M_data->_M_decimal_point = L'.';
23.1719 ++ _M_data->_M_thousands_sep = L',';
23.1720 ++ _M_data->_M_grouping = "";
23.1721 ++ _M_data->_M_grouping_size = 0;
23.1722 ++ _M_data->_M_curr_symbol = L"";
23.1723 ++ _M_data->_M_curr_symbol_size = 0;
23.1724 ++ _M_data->_M_positive_sign = L"";
23.1725 ++ _M_data->_M_positive_sign_size = 0;
23.1726 ++ _M_data->_M_negative_sign = L"";
23.1727 ++ _M_data->_M_negative_sign_size = 0;
23.1728 ++ _M_data->_M_frac_digits = 0;
23.1729 ++ _M_data->_M_pos_format = money_base::_S_default_pattern;
23.1730 ++ _M_data->_M_neg_format = money_base::_S_default_pattern;
23.1731 ++
23.1732 ++ // Use ctype::widen code without the facet...
23.1733 ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
23.1734 ++ _M_data->_M_atoms[__i] =
23.1735 ++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
23.1736 ++ }
23.1737 ++ else
23.1738 ++ {
23.1739 ++ // Named locale.
23.1740 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1741 ++ __c_locale __old = __uselocale(__cloc);
23.1742 ++#else
23.1743 ++ // Switch to named locale so that mbsrtowcs will work.
23.1744 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
23.1745 ++ setlocale(LC_ALL, __name);
23.1746 ++#endif
23.1747 ++
23.1748 ++#ifdef __UCLIBC_MJN3_ONLY__
23.1749 ++#warning fix this... should be monetary
23.1750 ++#endif
23.1751 ++#ifdef __UCLIBC__
23.1752 ++# ifdef __UCLIBC_HAS_XLOCALE__
23.1753 ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
23.1754 ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
23.1755 ++# else
23.1756 ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
23.1757 ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
23.1758 ++# endif
23.1759 ++#else
23.1760 ++ union { char *__s; wchar_t __w; } __u;
23.1761 ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
23.1762 ++ _M_data->_M_decimal_point = __u.__w;
23.1763 ++
23.1764 ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
23.1765 ++ _M_data->_M_thousands_sep = __u.__w;
23.1766 ++#endif
23.1767 ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
23.1768 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
23.1769 ++
23.1770 ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
23.1771 ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
23.1772 ++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
23.1773 ++
23.1774 ++ wchar_t* __wcs_ps = 0;
23.1775 ++ wchar_t* __wcs_ns = 0;
23.1776 ++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
23.1777 ++ try
23.1778 ++ {
23.1779 ++ mbstate_t __state;
23.1780 ++ size_t __len = strlen(__cpossign);
23.1781 ++ if (__len)
23.1782 ++ {
23.1783 ++ ++__len;
23.1784 ++ memset(&__state, 0, sizeof(mbstate_t));
23.1785 ++ __wcs_ps = new wchar_t[__len];
23.1786 ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
23.1787 ++ _M_data->_M_positive_sign = __wcs_ps;
23.1788 ++ }
23.1789 ++ else
23.1790 ++ _M_data->_M_positive_sign = L"";
23.1791 ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
23.1792 ++
23.1793 ++ __len = strlen(__cnegsign);
23.1794 ++ if (!__nposn)
23.1795 ++ _M_data->_M_negative_sign = L"()";
23.1796 ++ else if (__len)
23.1797 ++ {
23.1798 ++ ++__len;
23.1799 ++ memset(&__state, 0, sizeof(mbstate_t));
23.1800 ++ __wcs_ns = new wchar_t[__len];
23.1801 ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
23.1802 ++ _M_data->_M_negative_sign = __wcs_ns;
23.1803 ++ }
23.1804 ++ else
23.1805 ++ _M_data->_M_negative_sign = L"";
23.1806 ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
23.1807 ++
23.1808 ++ // _Intl == true.
23.1809 ++ __len = strlen(__ccurr);
23.1810 ++ if (__len)
23.1811 ++ {
23.1812 ++ ++__len;
23.1813 ++ memset(&__state, 0, sizeof(mbstate_t));
23.1814 ++ wchar_t* __wcs = new wchar_t[__len];
23.1815 ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
23.1816 ++ _M_data->_M_curr_symbol = __wcs;
23.1817 ++ }
23.1818 ++ else
23.1819 ++ _M_data->_M_curr_symbol = L"";
23.1820 ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
23.1821 ++ }
23.1822 ++ catch (...)
23.1823 ++ {
23.1824 ++ delete _M_data;
23.1825 ++ _M_data = 0;
23.1826 ++ delete __wcs_ps;
23.1827 ++ delete __wcs_ns;
23.1828 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1829 ++ __uselocale(__old);
23.1830 ++#else
23.1831 ++ setlocale(LC_ALL, __old);
23.1832 ++ free(__old);
23.1833 ++#endif
23.1834 ++ __throw_exception_again;
23.1835 ++ }
23.1836 ++
23.1837 ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
23.1838 ++ __cloc));
23.1839 ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
23.1840 ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
23.1841 ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
23.1842 ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
23.1843 ++ __pposn);
23.1844 ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
23.1845 ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
23.1846 ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
23.1847 ++ __nposn);
23.1848 ++
23.1849 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1850 ++ __uselocale(__old);
23.1851 ++#else
23.1852 ++ setlocale(LC_ALL, __old);
23.1853 ++ free(__old);
23.1854 ++#endif
23.1855 ++ }
23.1856 ++ }
23.1857 ++
23.1858 ++ template<>
23.1859 ++ void
23.1860 ++ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
23.1861 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1862 ++ const char*)
23.1863 ++#else
23.1864 ++ const char* __name)
23.1865 ++#endif
23.1866 ++ {
23.1867 ++ if (!_M_data)
23.1868 ++ _M_data = new __moneypunct_cache<wchar_t, false>;
23.1869 ++
23.1870 ++ if (!__cloc)
23.1871 ++ {
23.1872 ++ // "C" locale
23.1873 ++ _M_data->_M_decimal_point = L'.';
23.1874 ++ _M_data->_M_thousands_sep = L',';
23.1875 ++ _M_data->_M_grouping = "";
23.1876 ++ _M_data->_M_grouping_size = 0;
23.1877 ++ _M_data->_M_curr_symbol = L"";
23.1878 ++ _M_data->_M_curr_symbol_size = 0;
23.1879 ++ _M_data->_M_positive_sign = L"";
23.1880 ++ _M_data->_M_positive_sign_size = 0;
23.1881 ++ _M_data->_M_negative_sign = L"";
23.1882 ++ _M_data->_M_negative_sign_size = 0;
23.1883 ++ _M_data->_M_frac_digits = 0;
23.1884 ++ _M_data->_M_pos_format = money_base::_S_default_pattern;
23.1885 ++ _M_data->_M_neg_format = money_base::_S_default_pattern;
23.1886 ++
23.1887 ++ // Use ctype::widen code without the facet...
23.1888 ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
23.1889 ++ _M_data->_M_atoms[__i] =
23.1890 ++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
23.1891 ++ }
23.1892 ++ else
23.1893 ++ {
23.1894 ++ // Named locale.
23.1895 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1896 ++ __c_locale __old = __uselocale(__cloc);
23.1897 ++#else
23.1898 ++ // Switch to named locale so that mbsrtowcs will work.
23.1899 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
23.1900 ++ setlocale(LC_ALL, __name);
23.1901 ++#endif
23.1902 ++
23.1903 ++#ifdef __UCLIBC_MJN3_ONLY__
23.1904 ++#warning fix this... should be monetary
23.1905 ++#endif
23.1906 ++#ifdef __UCLIBC__
23.1907 ++# ifdef __UCLIBC_HAS_XLOCALE__
23.1908 ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
23.1909 ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
23.1910 ++# else
23.1911 ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
23.1912 ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
23.1913 ++# endif
23.1914 ++#else
23.1915 ++ union { char *__s; wchar_t __w; } __u;
23.1916 ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
23.1917 ++ _M_data->_M_decimal_point = __u.__w;
23.1918 ++
23.1919 ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
23.1920 ++ _M_data->_M_thousands_sep = __u.__w;
23.1921 ++#endif
23.1922 ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
23.1923 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
23.1924 ++
23.1925 ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
23.1926 ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
23.1927 ++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
23.1928 ++
23.1929 ++ wchar_t* __wcs_ps = 0;
23.1930 ++ wchar_t* __wcs_ns = 0;
23.1931 ++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
23.1932 ++ try
23.1933 ++ {
23.1934 ++ mbstate_t __state;
23.1935 ++ size_t __len;
23.1936 ++ __len = strlen(__cpossign);
23.1937 ++ if (__len)
23.1938 ++ {
23.1939 ++ ++__len;
23.1940 ++ memset(&__state, 0, sizeof(mbstate_t));
23.1941 ++ __wcs_ps = new wchar_t[__len];
23.1942 ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
23.1943 ++ _M_data->_M_positive_sign = __wcs_ps;
23.1944 ++ }
23.1945 ++ else
23.1946 ++ _M_data->_M_positive_sign = L"";
23.1947 ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
23.1948 ++
23.1949 ++ __len = strlen(__cnegsign);
23.1950 ++ if (!__nposn)
23.1951 ++ _M_data->_M_negative_sign = L"()";
23.1952 ++ else if (__len)
23.1953 ++ {
23.1954 ++ ++__len;
23.1955 ++ memset(&__state, 0, sizeof(mbstate_t));
23.1956 ++ __wcs_ns = new wchar_t[__len];
23.1957 ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
23.1958 ++ _M_data->_M_negative_sign = __wcs_ns;
23.1959 ++ }
23.1960 ++ else
23.1961 ++ _M_data->_M_negative_sign = L"";
23.1962 ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
23.1963 ++
23.1964 ++ // _Intl == true.
23.1965 ++ __len = strlen(__ccurr);
23.1966 ++ if (__len)
23.1967 ++ {
23.1968 ++ ++__len;
23.1969 ++ memset(&__state, 0, sizeof(mbstate_t));
23.1970 ++ wchar_t* __wcs = new wchar_t[__len];
23.1971 ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
23.1972 ++ _M_data->_M_curr_symbol = __wcs;
23.1973 ++ }
23.1974 ++ else
23.1975 ++ _M_data->_M_curr_symbol = L"";
23.1976 ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
23.1977 ++ }
23.1978 ++ catch (...)
23.1979 ++ {
23.1980 ++ delete _M_data;
23.1981 ++ _M_data = 0;
23.1982 ++ delete __wcs_ps;
23.1983 ++ delete __wcs_ns;
23.1984 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.1985 ++ __uselocale(__old);
23.1986 ++#else
23.1987 ++ setlocale(LC_ALL, __old);
23.1988 ++ free(__old);
23.1989 ++#endif
23.1990 ++ __throw_exception_again;
23.1991 ++ }
23.1992 ++
23.1993 ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
23.1994 ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
23.1995 ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
23.1996 ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
23.1997 ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
23.1998 ++ __pposn);
23.1999 ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
23.2000 ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
23.2001 ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
23.2002 ++ __nposn);
23.2003 ++
23.2004 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.2005 ++ __uselocale(__old);
23.2006 ++#else
23.2007 ++ setlocale(LC_ALL, __old);
23.2008 ++ free(__old);
23.2009 ++#endif
23.2010 ++ }
23.2011 ++ }
23.2012 ++
23.2013 ++ template<>
23.2014 ++ moneypunct<wchar_t, true>::~moneypunct()
23.2015 ++ {
23.2016 ++ if (_M_data->_M_positive_sign_size)
23.2017 ++ delete [] _M_data->_M_positive_sign;
23.2018 ++ if (_M_data->_M_negative_sign_size
23.2019 ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
23.2020 ++ delete [] _M_data->_M_negative_sign;
23.2021 ++ if (_M_data->_M_curr_symbol_size)
23.2022 ++ delete [] _M_data->_M_curr_symbol;
23.2023 ++ delete _M_data;
23.2024 ++ }
23.2025 ++
23.2026 ++ template<>
23.2027 ++ moneypunct<wchar_t, false>::~moneypunct()
23.2028 ++ {
23.2029 ++ if (_M_data->_M_positive_sign_size)
23.2030 ++ delete [] _M_data->_M_positive_sign;
23.2031 ++ if (_M_data->_M_negative_sign_size
23.2032 ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
23.2033 ++ delete [] _M_data->_M_negative_sign;
23.2034 ++ if (_M_data->_M_curr_symbol_size)
23.2035 ++ delete [] _M_data->_M_curr_symbol;
23.2036 ++ delete _M_data;
23.2037 ++ }
23.2038 ++#endif
23.2039 ++}
23.2040 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
23.2041 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100
23.2042 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:35.000000000 +0200
23.2043 +@@ -0,0 +1,160 @@
23.2044 ++// std::numpunct implementation details, GNU version -*- C++ -*-
23.2045 ++
23.2046 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
23.2047 ++//
23.2048 ++// This file is part of the GNU ISO C++ Library. This library is free
23.2049 ++// software; you can redistribute it and/or modify it under the
23.2050 ++// terms of the GNU General Public License as published by the
23.2051 ++// Free Software Foundation; either version 2, or (at your option)
23.2052 ++// any later version.
23.2053 ++
23.2054 ++// This library is distributed in the hope that it will be useful,
23.2055 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.2056 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.2057 ++// GNU General Public License for more details.
23.2058 ++
23.2059 ++// You should have received a copy of the GNU General Public License along
23.2060 ++// with this library; see the file COPYING. If not, write to the Free
23.2061 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.2062 ++// USA.
23.2063 ++
23.2064 ++// As a special exception, you may use this file as part of a free software
23.2065 ++// library without restriction. Specifically, if other files instantiate
23.2066 ++// templates or use macros or inline functions from this file, or you compile
23.2067 ++// this file and link it with other files to produce an executable, this
23.2068 ++// file does not by itself cause the resulting executable to be covered by
23.2069 ++// the GNU General Public License. This exception does not however
23.2070 ++// invalidate any other reasons why the executable file might be covered by
23.2071 ++// the GNU General Public License.
23.2072 ++
23.2073 ++//
23.2074 ++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
23.2075 ++//
23.2076 ++
23.2077 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.2078 ++
23.2079 ++#define _LIBC
23.2080 ++#include <locale>
23.2081 ++#undef _LIBC
23.2082 ++#include <bits/c++locale_internal.h>
23.2083 ++
23.2084 ++#ifdef __UCLIBC_MJN3_ONLY__
23.2085 ++#warning tailor for stub locale support
23.2086 ++#endif
23.2087 ++#ifndef __UCLIBC_HAS_XLOCALE__
23.2088 ++#define __nl_langinfo_l(N, L) nl_langinfo((N))
23.2089 ++#endif
23.2090 ++
23.2091 ++namespace std
23.2092 ++{
23.2093 ++ template<>
23.2094 ++ void
23.2095 ++ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
23.2096 ++ {
23.2097 ++ if (!_M_data)
23.2098 ++ _M_data = new __numpunct_cache<char>;
23.2099 ++
23.2100 ++ if (!__cloc)
23.2101 ++ {
23.2102 ++ // "C" locale
23.2103 ++ _M_data->_M_grouping = "";
23.2104 ++ _M_data->_M_grouping_size = 0;
23.2105 ++ _M_data->_M_use_grouping = false;
23.2106 ++
23.2107 ++ _M_data->_M_decimal_point = '.';
23.2108 ++ _M_data->_M_thousands_sep = ',';
23.2109 ++
23.2110 ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
23.2111 ++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
23.2112 ++
23.2113 ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
23.2114 ++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
23.2115 ++ }
23.2116 ++ else
23.2117 ++ {
23.2118 ++ // Named locale.
23.2119 ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
23.2120 ++ __cloc));
23.2121 ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
23.2122 ++ __cloc));
23.2123 ++
23.2124 ++ // Check for NULL, which implies no grouping.
23.2125 ++ if (_M_data->_M_thousands_sep == '\0')
23.2126 ++ _M_data->_M_grouping = "";
23.2127 ++ else
23.2128 ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
23.2129 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
23.2130 ++ }
23.2131 ++
23.2132 ++ // NB: There is no way to extact this info from posix locales.
23.2133 ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
23.2134 ++ _M_data->_M_truename = "true";
23.2135 ++ _M_data->_M_truename_size = 4;
23.2136 ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
23.2137 ++ _M_data->_M_falsename = "false";
23.2138 ++ _M_data->_M_falsename_size = 5;
23.2139 ++ }
23.2140 ++
23.2141 ++ template<>
23.2142 ++ numpunct<char>::~numpunct()
23.2143 ++ { delete _M_data; }
23.2144 ++
23.2145 ++#ifdef _GLIBCXX_USE_WCHAR_T
23.2146 ++ template<>
23.2147 ++ void
23.2148 ++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
23.2149 ++ {
23.2150 ++ if (!_M_data)
23.2151 ++ _M_data = new __numpunct_cache<wchar_t>;
23.2152 ++
23.2153 ++ if (!__cloc)
23.2154 ++ {
23.2155 ++ // "C" locale
23.2156 ++ _M_data->_M_grouping = "";
23.2157 ++ _M_data->_M_grouping_size = 0;
23.2158 ++ _M_data->_M_use_grouping = false;
23.2159 ++
23.2160 ++ _M_data->_M_decimal_point = L'.';
23.2161 ++ _M_data->_M_thousands_sep = L',';
23.2162 ++
23.2163 ++ // Use ctype::widen code without the facet...
23.2164 ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
23.2165 ++ _M_data->_M_atoms_out[__i] =
23.2166 ++ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
23.2167 ++
23.2168 ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
23.2169 ++ _M_data->_M_atoms_in[__j] =
23.2170 ++ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
23.2171 ++ }
23.2172 ++ else
23.2173 ++ {
23.2174 ++ // Named locale.
23.2175 ++ // NB: In the GNU model wchar_t is always 32 bit wide.
23.2176 ++ union { char *__s; wchar_t __w; } __u;
23.2177 ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
23.2178 ++ _M_data->_M_decimal_point = __u.__w;
23.2179 ++
23.2180 ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
23.2181 ++ _M_data->_M_thousands_sep = __u.__w;
23.2182 ++
23.2183 ++ if (_M_data->_M_thousands_sep == L'\0')
23.2184 ++ _M_data->_M_grouping = "";
23.2185 ++ else
23.2186 ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
23.2187 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
23.2188 ++ }
23.2189 ++
23.2190 ++ // NB: There is no way to extact this info from posix locales.
23.2191 ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
23.2192 ++ _M_data->_M_truename = L"true";
23.2193 ++ _M_data->_M_truename_size = 4;
23.2194 ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
23.2195 ++ _M_data->_M_falsename = L"false";
23.2196 ++ _M_data->_M_falsename_size = 5;
23.2197 ++ }
23.2198 ++
23.2199 ++ template<>
23.2200 ++ numpunct<wchar_t>::~numpunct()
23.2201 ++ { delete _M_data; }
23.2202 ++ #endif
23.2203 ++}
23.2204 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc
23.2205 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100
23.2206 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:35.000000000 +0200
23.2207 +@@ -0,0 +1,406 @@
23.2208 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
23.2209 ++
23.2210 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
23.2211 ++//
23.2212 ++// This file is part of the GNU ISO C++ Library. This library is free
23.2213 ++// software; you can redistribute it and/or modify it under the
23.2214 ++// terms of the GNU General Public License as published by the
23.2215 ++// Free Software Foundation; either version 2, or (at your option)
23.2216 ++// any later version.
23.2217 ++
23.2218 ++// This library is distributed in the hope that it will be useful,
23.2219 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.2220 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.2221 ++// GNU General Public License for more details.
23.2222 ++
23.2223 ++// You should have received a copy of the GNU General Public License along
23.2224 ++// with this library; see the file COPYING. If not, write to the Free
23.2225 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.2226 ++// USA.
23.2227 ++
23.2228 ++// As a special exception, you may use this file as part of a free software
23.2229 ++// library without restriction. Specifically, if other files instantiate
23.2230 ++// templates or use macros or inline functions from this file, or you compile
23.2231 ++// this file and link it with other files to produce an executable, this
23.2232 ++// file does not by itself cause the resulting executable to be covered by
23.2233 ++// the GNU General Public License. This exception does not however
23.2234 ++// invalidate any other reasons why the executable file might be covered by
23.2235 ++// the GNU General Public License.
23.2236 ++
23.2237 ++//
23.2238 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
23.2239 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
23.2240 ++//
23.2241 ++
23.2242 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.2243 ++
23.2244 ++#include <locale>
23.2245 ++#include <bits/c++locale_internal.h>
23.2246 ++
23.2247 ++#ifdef __UCLIBC_MJN3_ONLY__
23.2248 ++#warning tailor for stub locale support
23.2249 ++#endif
23.2250 ++#ifndef __UCLIBC_HAS_XLOCALE__
23.2251 ++#define __nl_langinfo_l(N, L) nl_langinfo((N))
23.2252 ++#endif
23.2253 ++
23.2254 ++namespace std
23.2255 ++{
23.2256 ++ template<>
23.2257 ++ void
23.2258 ++ __timepunct<char>::
23.2259 ++ _M_put(char* __s, size_t __maxlen, const char* __format,
23.2260 ++ const tm* __tm) const
23.2261 ++ {
23.2262 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.2263 ++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
23.2264 ++ _M_c_locale_timepunct);
23.2265 ++#else
23.2266 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
23.2267 ++ setlocale(LC_ALL, _M_name_timepunct);
23.2268 ++ const size_t __len = strftime(__s, __maxlen, __format, __tm);
23.2269 ++ setlocale(LC_ALL, __old);
23.2270 ++ free(__old);
23.2271 ++#endif
23.2272 ++ // Make sure __s is null terminated.
23.2273 ++ if (__len == 0)
23.2274 ++ __s[0] = '\0';
23.2275 ++ }
23.2276 ++
23.2277 ++ template<>
23.2278 ++ void
23.2279 ++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
23.2280 ++ {
23.2281 ++ if (!_M_data)
23.2282 ++ _M_data = new __timepunct_cache<char>;
23.2283 ++
23.2284 ++ if (!__cloc)
23.2285 ++ {
23.2286 ++ // "C" locale
23.2287 ++ _M_c_locale_timepunct = _S_get_c_locale();
23.2288 ++
23.2289 ++ _M_data->_M_date_format = "%m/%d/%y";
23.2290 ++ _M_data->_M_date_era_format = "%m/%d/%y";
23.2291 ++ _M_data->_M_time_format = "%H:%M:%S";
23.2292 ++ _M_data->_M_time_era_format = "%H:%M:%S";
23.2293 ++ _M_data->_M_date_time_format = "";
23.2294 ++ _M_data->_M_date_time_era_format = "";
23.2295 ++ _M_data->_M_am = "AM";
23.2296 ++ _M_data->_M_pm = "PM";
23.2297 ++ _M_data->_M_am_pm_format = "";
23.2298 ++
23.2299 ++ // Day names, starting with "C"'s Sunday.
23.2300 ++ _M_data->_M_day1 = "Sunday";
23.2301 ++ _M_data->_M_day2 = "Monday";
23.2302 ++ _M_data->_M_day3 = "Tuesday";
23.2303 ++ _M_data->_M_day4 = "Wednesday";
23.2304 ++ _M_data->_M_day5 = "Thursday";
23.2305 ++ _M_data->_M_day6 = "Friday";
23.2306 ++ _M_data->_M_day7 = "Saturday";
23.2307 ++
23.2308 ++ // Abbreviated day names, starting with "C"'s Sun.
23.2309 ++ _M_data->_M_aday1 = "Sun";
23.2310 ++ _M_data->_M_aday2 = "Mon";
23.2311 ++ _M_data->_M_aday3 = "Tue";
23.2312 ++ _M_data->_M_aday4 = "Wed";
23.2313 ++ _M_data->_M_aday5 = "Thu";
23.2314 ++ _M_data->_M_aday6 = "Fri";
23.2315 ++ _M_data->_M_aday7 = "Sat";
23.2316 ++
23.2317 ++ // Month names, starting with "C"'s January.
23.2318 ++ _M_data->_M_month01 = "January";
23.2319 ++ _M_data->_M_month02 = "February";
23.2320 ++ _M_data->_M_month03 = "March";
23.2321 ++ _M_data->_M_month04 = "April";
23.2322 ++ _M_data->_M_month05 = "May";
23.2323 ++ _M_data->_M_month06 = "June";
23.2324 ++ _M_data->_M_month07 = "July";
23.2325 ++ _M_data->_M_month08 = "August";
23.2326 ++ _M_data->_M_month09 = "September";
23.2327 ++ _M_data->_M_month10 = "October";
23.2328 ++ _M_data->_M_month11 = "November";
23.2329 ++ _M_data->_M_month12 = "December";
23.2330 ++
23.2331 ++ // Abbreviated month names, starting with "C"'s Jan.
23.2332 ++ _M_data->_M_amonth01 = "Jan";
23.2333 ++ _M_data->_M_amonth02 = "Feb";
23.2334 ++ _M_data->_M_amonth03 = "Mar";
23.2335 ++ _M_data->_M_amonth04 = "Apr";
23.2336 ++ _M_data->_M_amonth05 = "May";
23.2337 ++ _M_data->_M_amonth06 = "Jun";
23.2338 ++ _M_data->_M_amonth07 = "Jul";
23.2339 ++ _M_data->_M_amonth08 = "Aug";
23.2340 ++ _M_data->_M_amonth09 = "Sep";
23.2341 ++ _M_data->_M_amonth10 = "Oct";
23.2342 ++ _M_data->_M_amonth11 = "Nov";
23.2343 ++ _M_data->_M_amonth12 = "Dec";
23.2344 ++ }
23.2345 ++ else
23.2346 ++ {
23.2347 ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
23.2348 ++
23.2349 ++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
23.2350 ++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
23.2351 ++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
23.2352 ++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
23.2353 ++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
23.2354 ++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
23.2355 ++ __cloc);
23.2356 ++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
23.2357 ++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
23.2358 ++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
23.2359 ++
23.2360 ++ // Day names, starting with "C"'s Sunday.
23.2361 ++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
23.2362 ++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
23.2363 ++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
23.2364 ++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
23.2365 ++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
23.2366 ++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
23.2367 ++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
23.2368 ++
23.2369 ++ // Abbreviated day names, starting with "C"'s Sun.
23.2370 ++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
23.2371 ++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
23.2372 ++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
23.2373 ++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
23.2374 ++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
23.2375 ++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
23.2376 ++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
23.2377 ++
23.2378 ++ // Month names, starting with "C"'s January.
23.2379 ++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
23.2380 ++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
23.2381 ++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
23.2382 ++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
23.2383 ++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
23.2384 ++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
23.2385 ++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
23.2386 ++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
23.2387 ++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
23.2388 ++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
23.2389 ++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
23.2390 ++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
23.2391 ++
23.2392 ++ // Abbreviated month names, starting with "C"'s Jan.
23.2393 ++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
23.2394 ++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
23.2395 ++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
23.2396 ++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
23.2397 ++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
23.2398 ++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
23.2399 ++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
23.2400 ++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
23.2401 ++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
23.2402 ++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
23.2403 ++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
23.2404 ++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
23.2405 ++ }
23.2406 ++ }
23.2407 ++
23.2408 ++#ifdef _GLIBCXX_USE_WCHAR_T
23.2409 ++ template<>
23.2410 ++ void
23.2411 ++ __timepunct<wchar_t>::
23.2412 ++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
23.2413 ++ const tm* __tm) const
23.2414 ++ {
23.2415 ++#ifdef __UCLIBC_HAS_XLOCALE__
23.2416 ++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
23.2417 ++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
23.2418 ++ _M_c_locale_timepunct);
23.2419 ++#else
23.2420 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
23.2421 ++ setlocale(LC_ALL, _M_name_timepunct);
23.2422 ++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
23.2423 ++ setlocale(LC_ALL, __old);
23.2424 ++ free(__old);
23.2425 ++#endif
23.2426 ++ // Make sure __s is null terminated.
23.2427 ++ if (__len == 0)
23.2428 ++ __s[0] = L'\0';
23.2429 ++ }
23.2430 ++
23.2431 ++ template<>
23.2432 ++ void
23.2433 ++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
23.2434 ++ {
23.2435 ++ if (!_M_data)
23.2436 ++ _M_data = new __timepunct_cache<wchar_t>;
23.2437 ++
23.2438 ++#warning wide time stuff
23.2439 ++// if (!__cloc)
23.2440 ++ {
23.2441 ++ // "C" locale
23.2442 ++ _M_c_locale_timepunct = _S_get_c_locale();
23.2443 ++
23.2444 ++ _M_data->_M_date_format = L"%m/%d/%y";
23.2445 ++ _M_data->_M_date_era_format = L"%m/%d/%y";
23.2446 ++ _M_data->_M_time_format = L"%H:%M:%S";
23.2447 ++ _M_data->_M_time_era_format = L"%H:%M:%S";
23.2448 ++ _M_data->_M_date_time_format = L"";
23.2449 ++ _M_data->_M_date_time_era_format = L"";
23.2450 ++ _M_data->_M_am = L"AM";
23.2451 ++ _M_data->_M_pm = L"PM";
23.2452 ++ _M_data->_M_am_pm_format = L"";
23.2453 ++
23.2454 ++ // Day names, starting with "C"'s Sunday.
23.2455 ++ _M_data->_M_day1 = L"Sunday";
23.2456 ++ _M_data->_M_day2 = L"Monday";
23.2457 ++ _M_data->_M_day3 = L"Tuesday";
23.2458 ++ _M_data->_M_day4 = L"Wednesday";
23.2459 ++ _M_data->_M_day5 = L"Thursday";
23.2460 ++ _M_data->_M_day6 = L"Friday";
23.2461 ++ _M_data->_M_day7 = L"Saturday";
23.2462 ++
23.2463 ++ // Abbreviated day names, starting with "C"'s Sun.
23.2464 ++ _M_data->_M_aday1 = L"Sun";
23.2465 ++ _M_data->_M_aday2 = L"Mon";
23.2466 ++ _M_data->_M_aday3 = L"Tue";
23.2467 ++ _M_data->_M_aday4 = L"Wed";
23.2468 ++ _M_data->_M_aday5 = L"Thu";
23.2469 ++ _M_data->_M_aday6 = L"Fri";
23.2470 ++ _M_data->_M_aday7 = L"Sat";
23.2471 ++
23.2472 ++ // Month names, starting with "C"'s January.
23.2473 ++ _M_data->_M_month01 = L"January";
23.2474 ++ _M_data->_M_month02 = L"February";
23.2475 ++ _M_data->_M_month03 = L"March";
23.2476 ++ _M_data->_M_month04 = L"April";
23.2477 ++ _M_data->_M_month05 = L"May";
23.2478 ++ _M_data->_M_month06 = L"June";
23.2479 ++ _M_data->_M_month07 = L"July";
23.2480 ++ _M_data->_M_month08 = L"August";
23.2481 ++ _M_data->_M_month09 = L"September";
23.2482 ++ _M_data->_M_month10 = L"October";
23.2483 ++ _M_data->_M_month11 = L"November";
23.2484 ++ _M_data->_M_month12 = L"December";
23.2485 ++
23.2486 ++ // Abbreviated month names, starting with "C"'s Jan.
23.2487 ++ _M_data->_M_amonth01 = L"Jan";
23.2488 ++ _M_data->_M_amonth02 = L"Feb";
23.2489 ++ _M_data->_M_amonth03 = L"Mar";
23.2490 ++ _M_data->_M_amonth04 = L"Apr";
23.2491 ++ _M_data->_M_amonth05 = L"May";
23.2492 ++ _M_data->_M_amonth06 = L"Jun";
23.2493 ++ _M_data->_M_amonth07 = L"Jul";
23.2494 ++ _M_data->_M_amonth08 = L"Aug";
23.2495 ++ _M_data->_M_amonth09 = L"Sep";
23.2496 ++ _M_data->_M_amonth10 = L"Oct";
23.2497 ++ _M_data->_M_amonth11 = L"Nov";
23.2498 ++ _M_data->_M_amonth12 = L"Dec";
23.2499 ++ }
23.2500 ++#if 0
23.2501 ++ else
23.2502 ++ {
23.2503 ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
23.2504 ++
23.2505 ++ union { char *__s; wchar_t *__w; } __u;
23.2506 ++
23.2507 ++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
23.2508 ++ _M_data->_M_date_format = __u.__w;
23.2509 ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
23.2510 ++ _M_data->_M_date_era_format = __u.__w;
23.2511 ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
23.2512 ++ _M_data->_M_time_format = __u.__w;
23.2513 ++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
23.2514 ++ _M_data->_M_time_era_format = __u.__w;
23.2515 ++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
23.2516 ++ _M_data->_M_date_time_format = __u.__w;
23.2517 ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
23.2518 ++ _M_data->_M_date_time_era_format = __u.__w;
23.2519 ++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
23.2520 ++ _M_data->_M_am = __u.__w;
23.2521 ++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
23.2522 ++ _M_data->_M_pm = __u.__w;
23.2523 ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
23.2524 ++ _M_data->_M_am_pm_format = __u.__w;
23.2525 ++
23.2526 ++ // Day names, starting with "C"'s Sunday.
23.2527 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
23.2528 ++ _M_data->_M_day1 = __u.__w;
23.2529 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
23.2530 ++ _M_data->_M_day2 = __u.__w;
23.2531 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
23.2532 ++ _M_data->_M_day3 = __u.__w;
23.2533 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
23.2534 ++ _M_data->_M_day4 = __u.__w;
23.2535 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
23.2536 ++ _M_data->_M_day5 = __u.__w;
23.2537 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
23.2538 ++ _M_data->_M_day6 = __u.__w;
23.2539 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
23.2540 ++ _M_data->_M_day7 = __u.__w;
23.2541 ++
23.2542 ++ // Abbreviated day names, starting with "C"'s Sun.
23.2543 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
23.2544 ++ _M_data->_M_aday1 = __u.__w;
23.2545 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
23.2546 ++ _M_data->_M_aday2 = __u.__w;
23.2547 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
23.2548 ++ _M_data->_M_aday3 = __u.__w;
23.2549 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
23.2550 ++ _M_data->_M_aday4 = __u.__w;
23.2551 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
23.2552 ++ _M_data->_M_aday5 = __u.__w;
23.2553 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
23.2554 ++ _M_data->_M_aday6 = __u.__w;
23.2555 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
23.2556 ++ _M_data->_M_aday7 = __u.__w;
23.2557 ++
23.2558 ++ // Month names, starting with "C"'s January.
23.2559 ++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
23.2560 ++ _M_data->_M_month01 = __u.__w;
23.2561 ++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
23.2562 ++ _M_data->_M_month02 = __u.__w;
23.2563 ++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
23.2564 ++ _M_data->_M_month03 = __u.__w;
23.2565 ++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
23.2566 ++ _M_data->_M_month04 = __u.__w;
23.2567 ++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
23.2568 ++ _M_data->_M_month05 = __u.__w;
23.2569 ++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
23.2570 ++ _M_data->_M_month06 = __u.__w;
23.2571 ++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
23.2572 ++ _M_data->_M_month07 = __u.__w;
23.2573 ++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
23.2574 ++ _M_data->_M_month08 = __u.__w;
23.2575 ++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
23.2576 ++ _M_data->_M_month09 = __u.__w;
23.2577 ++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
23.2578 ++ _M_data->_M_month10 = __u.__w;
23.2579 ++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
23.2580 ++ _M_data->_M_month11 = __u.__w;
23.2581 ++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
23.2582 ++ _M_data->_M_month12 = __u.__w;
23.2583 ++
23.2584 ++ // Abbreviated month names, starting with "C"'s Jan.
23.2585 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
23.2586 ++ _M_data->_M_amonth01 = __u.__w;
23.2587 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
23.2588 ++ _M_data->_M_amonth02 = __u.__w;
23.2589 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
23.2590 ++ _M_data->_M_amonth03 = __u.__w;
23.2591 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
23.2592 ++ _M_data->_M_amonth04 = __u.__w;
23.2593 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
23.2594 ++ _M_data->_M_amonth05 = __u.__w;
23.2595 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
23.2596 ++ _M_data->_M_amonth06 = __u.__w;
23.2597 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
23.2598 ++ _M_data->_M_amonth07 = __u.__w;
23.2599 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
23.2600 ++ _M_data->_M_amonth08 = __u.__w;
23.2601 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
23.2602 ++ _M_data->_M_amonth09 = __u.__w;
23.2603 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
23.2604 ++ _M_data->_M_amonth10 = __u.__w;
23.2605 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
23.2606 ++ _M_data->_M_amonth11 = __u.__w;
23.2607 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
23.2608 ++ _M_data->_M_amonth12 = __u.__w;
23.2609 ++ }
23.2610 ++#endif // 0
23.2611 ++ }
23.2612 ++#endif
23.2613 ++}
23.2614 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
23.2615 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100
23.2616 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:35.000000000 +0200
23.2617 +@@ -0,0 +1,68 @@
23.2618 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
23.2619 ++
23.2620 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
23.2621 ++//
23.2622 ++// This file is part of the GNU ISO C++ Library. This library is free
23.2623 ++// software; you can redistribute it and/or modify it under the
23.2624 ++// terms of the GNU General Public License as published by the
23.2625 ++// Free Software Foundation; either version 2, or (at your option)
23.2626 ++// any later version.
23.2627 ++
23.2628 ++// This library is distributed in the hope that it will be useful,
23.2629 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
23.2630 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.2631 ++// GNU General Public License for more details.
23.2632 ++
23.2633 ++// You should have received a copy of the GNU General Public License along
23.2634 ++// with this library; see the file COPYING. If not, write to the Free
23.2635 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23.2636 ++// USA.
23.2637 ++
23.2638 ++// As a special exception, you may use this file as part of a free software
23.2639 ++// library without restriction. Specifically, if other files instantiate
23.2640 ++// templates or use macros or inline functions from this file, or you compile
23.2641 ++// this file and link it with other files to produce an executable, this
23.2642 ++// file does not by itself cause the resulting executable to be covered by
23.2643 ++// the GNU General Public License. This exception does not however
23.2644 ++// invalidate any other reasons why the executable file might be covered by
23.2645 ++// the GNU General Public License.
23.2646 ++
23.2647 ++//
23.2648 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
23.2649 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
23.2650 ++//
23.2651 ++
23.2652 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
23.2653 ++
23.2654 ++ template<typename _CharT>
23.2655 ++ __timepunct<_CharT>::__timepunct(size_t __refs)
23.2656 ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
23.2657 ++ _M_name_timepunct(_S_get_c_name())
23.2658 ++ { _M_initialize_timepunct(); }
23.2659 ++
23.2660 ++ template<typename _CharT>
23.2661 ++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
23.2662 ++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
23.2663 ++ _M_name_timepunct(_S_get_c_name())
23.2664 ++ { _M_initialize_timepunct(); }
23.2665 ++
23.2666 ++ template<typename _CharT>
23.2667 ++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
23.2668 ++ size_t __refs)
23.2669 ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
23.2670 ++ _M_name_timepunct(__s)
23.2671 ++ {
23.2672 ++ char* __tmp = new char[std::strlen(__s) + 1];
23.2673 ++ std::strcpy(__tmp, __s);
23.2674 ++ _M_name_timepunct = __tmp;
23.2675 ++ _M_initialize_timepunct(__cloc);
23.2676 ++ }
23.2677 ++
23.2678 ++ template<typename _CharT>
23.2679 ++ __timepunct<_CharT>::~__timepunct()
23.2680 ++ {
23.2681 ++ if (_M_name_timepunct != _S_get_c_name())
23.2682 ++ delete [] _M_name_timepunct;
23.2683 ++ delete _M_data;
23.2684 ++ _S_destroy_c_locale(_M_c_locale_timepunct);
23.2685 ++ }
23.2686 +diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
23.2687 +--- gcc-4.3.0.orig/libstdc++-v3/configure 2008-02-29 01:00:39.000000000 +0100
23.2688 ++++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:35.000000000 +0200
23.2689 +@@ -14001,7 +14001,7 @@
23.2690 + enableval="$enable_clocale"
23.2691 +
23.2692 + case "$enableval" in
23.2693 +- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
23.2694 ++ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
23.2695 + *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
23.2696 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
23.2697 + { (exit 1); exit 1; }; } ;;
23.2698 +@@ -14034,6 +14034,9 @@
23.2699 + # Default to "generic".
23.2700 + if test $enable_clocale_flag = auto; then
23.2701 + case ${target_os} in
23.2702 ++ linux-uclibc*)
23.2703 ++ enable_clocale_flag=uclibc
23.2704 ++ ;;
23.2705 + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
23.2706 + enable_clocale_flag=gnu
23.2707 + ;;
23.2708 +@@ -14422,6 +14425,76 @@
23.2709 + CTIME_CC=config/locale/generic/time_members.cc
23.2710 + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
23.2711 + ;;
23.2712 ++ uclibc)
23.2713 ++ echo "$as_me:$LINENO: result: uclibc" >&5
23.2714 ++echo "${ECHO_T}uclibc" >&6
23.2715 ++
23.2716 ++ # Declare intention to use gettext, and add support for specific
23.2717 ++ # languages.
23.2718 ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
23.2719 ++ ALL_LINGUAS="de fr"
23.2720 ++
23.2721 ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
23.2722 ++ # Extract the first word of "msgfmt", so it can be a program name with args.
23.2723 ++set dummy msgfmt; ac_word=$2
23.2724 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
23.2725 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
23.2726 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
23.2727 ++ echo $ECHO_N "(cached) $ECHO_C" >&6
23.2728 ++else
23.2729 ++ if test -n "$check_msgfmt"; then
23.2730 ++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
23.2731 ++else
23.2732 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
23.2733 ++for as_dir in $PATH
23.2734 ++do
23.2735 ++ IFS=$as_save_IFS
23.2736 ++ test -z "$as_dir" && as_dir=.
23.2737 ++ for ac_exec_ext in '' $ac_executable_extensions; do
23.2738 ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
23.2739 ++ ac_cv_prog_check_msgfmt="yes"
23.2740 ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
23.2741 ++ break 2
23.2742 ++ fi
23.2743 ++done
23.2744 ++done
23.2745 ++
23.2746 ++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
23.2747 ++fi
23.2748 ++fi
23.2749 ++check_msgfmt=$ac_cv_prog_check_msgfmt
23.2750 ++if test -n "$check_msgfmt"; then
23.2751 ++ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
23.2752 ++echo "${ECHO_T}$check_msgfmt" >&6
23.2753 ++else
23.2754 ++ echo "$as_me:$LINENO: result: no" >&5
23.2755 ++echo "${ECHO_T}no" >&6
23.2756 ++fi
23.2757 ++
23.2758 ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
23.2759 ++ USE_NLS=yes
23.2760 ++ fi
23.2761 ++ # Export the build objects.
23.2762 ++ for ling in $ALL_LINGUAS; do \
23.2763 ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
23.2764 ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
23.2765 ++ done
23.2766 ++
23.2767 ++
23.2768 ++
23.2769 ++ CLOCALE_H=config/locale/uclibc/c_locale.h
23.2770 ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
23.2771 ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
23.2772 ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
23.2773 ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
23.2774 ++ CMESSAGES_H=config/locale/uclibc/messages_members.h
23.2775 ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
23.2776 ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
23.2777 ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
23.2778 ++ CTIME_H=config/locale/uclibc/time_members.h
23.2779 ++ CTIME_CC=config/locale/uclibc/time_members.cc
23.2780 ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
23.2781 ++ ;;
23.2782 + esac
23.2783 +
23.2784 + # This is where the testsuite looks for locale catalogs, using the
23.2785 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h
23.2786 +--- gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 23:59:49.000000000 +0100
23.2787 ++++ gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h 2008-06-10 14:45:35.000000000 +0200
23.2788 +@@ -106,7 +106,9 @@
23.2789 + using std::wmemcpy;
23.2790 + using std::wmemmove;
23.2791 + using std::wmemset;
23.2792 ++#if _GLIBCXX_HAVE_WCSFTIME
23.2793 + using std::wcsftime;
23.2794 ++#endif
23.2795 +
23.2796 + #if _GLIBCXX_USE_C99
23.2797 + using std::wcstold;
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
24.2 +++ b/patches/gcc/4.3.0/675-203-uclibc-locale-no__x.patch Tue Jun 10 22:10:40 2008 +0000
24.3 @@ -0,0 +1,224 @@
24.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_203-uclibc-locale-no__x.patch
24.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
24.6 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:39.000000000 +0200
24.7 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:39.000000000 +0200
24.8 +@@ -60,4 +60,49 @@
24.9 + extern "C" __typeof(wctype_l) __wctype_l;
24.10 + #endif
24.11 +
24.12 ++# define __nl_langinfo_l nl_langinfo_l
24.13 ++# define __strcoll_l strcoll_l
24.14 ++# define __strftime_l strftime_l
24.15 ++# define __strtod_l strtod_l
24.16 ++# define __strtof_l strtof_l
24.17 ++# define __strtold_l strtold_l
24.18 ++# define __strxfrm_l strxfrm_l
24.19 ++# define __newlocale newlocale
24.20 ++# define __freelocale freelocale
24.21 ++# define __duplocale duplocale
24.22 ++# define __uselocale uselocale
24.23 ++
24.24 ++# ifdef _GLIBCXX_USE_WCHAR_T
24.25 ++# define __iswctype_l iswctype_l
24.26 ++# define __towlower_l towlower_l
24.27 ++# define __towupper_l towupper_l
24.28 ++# define __wcscoll_l wcscoll_l
24.29 ++# define __wcsftime_l wcsftime_l
24.30 ++# define __wcsxfrm_l wcsxfrm_l
24.31 ++# define __wctype_l wctype_l
24.32 ++# endif
24.33 ++
24.34 ++#else
24.35 ++# define __nl_langinfo_l(N, L) nl_langinfo((N))
24.36 ++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
24.37 ++# define __strtod_l(S, E, L) strtod((S), (E))
24.38 ++# define __strtof_l(S, E, L) strtof((S), (E))
24.39 ++# define __strtold_l(S, E, L) strtold((S), (E))
24.40 ++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
24.41 ++# warning should dummy __newlocale check for C|POSIX ?
24.42 ++# define __newlocale(a, b, c) NULL
24.43 ++# define __freelocale(a) ((void)0)
24.44 ++# define __duplocale(a) __c_locale()
24.45 ++//# define __uselocale ?
24.46 ++//
24.47 ++# ifdef _GLIBCXX_USE_WCHAR_T
24.48 ++# define __iswctype_l(C, M, L) iswctype((C), (M))
24.49 ++# define __towlower_l(C, L) towlower((C))
24.50 ++# define __towupper_l(C, L) towupper((C))
24.51 ++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
24.52 ++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
24.53 ++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
24.54 ++# define __wctype_l(S, L) wctype((S))
24.55 ++# endif
24.56 ++
24.57 + #endif // GLIBC 2.3 and later
24.58 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
24.59 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:39.000000000 +0200
24.60 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:39.000000000 +0200
24.61 +@@ -39,20 +39,6 @@
24.62 + #include <langinfo.h>
24.63 + #include <bits/c++locale_internal.h>
24.64 +
24.65 +-#ifndef __UCLIBC_HAS_XLOCALE__
24.66 +-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
24.67 +-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
24.68 +-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
24.69 +-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
24.70 +-#define __strtof_l(S, E, L) strtof((S), (E))
24.71 +-#define __strtod_l(S, E, L) strtod((S), (E))
24.72 +-#define __strtold_l(S, E, L) strtold((S), (E))
24.73 +-#warning should dummy __newlocale check for C|POSIX ?
24.74 +-#define __newlocale(a, b, c) NULL
24.75 +-#define __freelocale(a) ((void)0)
24.76 +-#define __duplocale(a) __c_locale()
24.77 +-#endif
24.78 +-
24.79 + namespace std
24.80 + {
24.81 + template<>
24.82 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
24.83 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:39.000000000 +0200
24.84 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:39.000000000 +0200
24.85 +@@ -68,6 +68,7 @@
24.86 + {
24.87 + extern "C" __typeof(uselocale) __uselocale;
24.88 + }
24.89 ++#define __uselocale uselocale
24.90 + #endif
24.91 +
24.92 + namespace std
24.93 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
24.94 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:39.000000000 +0200
24.95 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:39.000000000 +0200
24.96 +@@ -36,13 +36,6 @@
24.97 + #include <locale>
24.98 + #include <bits/c++locale_internal.h>
24.99 +
24.100 +-#ifndef __UCLIBC_HAS_XLOCALE__
24.101 +-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
24.102 +-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
24.103 +-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
24.104 +-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
24.105 +-#endif
24.106 +-
24.107 + namespace std
24.108 + {
24.109 + // These are basically extensions to char_traits, and perhaps should
24.110 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
24.111 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:39.000000000 +0200
24.112 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:39.000000000 +0200
24.113 +@@ -38,13 +38,6 @@
24.114 + #undef _LIBC
24.115 + #include <bits/c++locale_internal.h>
24.116 +
24.117 +-#ifndef __UCLIBC_HAS_XLOCALE__
24.118 +-#define __wctype_l(S, L) wctype((S))
24.119 +-#define __towupper_l(C, L) towupper((C))
24.120 +-#define __towlower_l(C, L) towlower((C))
24.121 +-#define __iswctype_l(C, M, L) iswctype((C), (M))
24.122 +-#endif
24.123 +-
24.124 + namespace std
24.125 + {
24.126 + // NB: The other ctype<char> specializations are in src/locale.cc and
24.127 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
24.128 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:39.000000000 +0200
24.129 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:39.000000000 +0200
24.130 +@@ -39,13 +39,10 @@
24.131 + #ifdef __UCLIBC_MJN3_ONLY__
24.132 + #warning fix gettext stuff
24.133 + #endif
24.134 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
24.135 +-extern "C" char *__dcgettext(const char *domainname,
24.136 +- const char *msgid, int category);
24.137 + #undef gettext
24.138 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
24.139 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
24.140 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
24.141 + #else
24.142 +-#undef gettext
24.143 + #define gettext(msgid) (msgid)
24.144 + #endif
24.145 +
24.146 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
24.147 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:39.000000000 +0200
24.148 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:39.000000000 +0200
24.149 +@@ -36,15 +36,11 @@
24.150 + #ifdef __UCLIBC_MJN3_ONLY__
24.151 + #warning fix prototypes for *textdomain funcs
24.152 + #endif
24.153 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
24.154 +-extern "C" char *__textdomain(const char *domainname);
24.155 +-extern "C" char *__bindtextdomain(const char *domainname,
24.156 +- const char *dirname);
24.157 +-#else
24.158 +-#undef __textdomain
24.159 +-#undef __bindtextdomain
24.160 +-#define __textdomain(D) ((void)0)
24.161 +-#define __bindtextdomain(D,P) ((void)0)
24.162 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
24.163 ++#undef textdomain
24.164 ++#undef bindtextdomain
24.165 ++#define textdomain(D) ((void)0)
24.166 ++#define bindtextdomain(D,P) ((void)0)
24.167 + #endif
24.168 +
24.169 + // Non-virtual member functions.
24.170 +@@ -70,7 +66,7 @@
24.171 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
24.172 + const char* __dir) const
24.173 + {
24.174 +- __bindtextdomain(__s.c_str(), __dir);
24.175 ++ bindtextdomain(__s.c_str(), __dir);
24.176 + return this->do_open(__s, __loc);
24.177 + }
24.178 +
24.179 +@@ -90,7 +86,7 @@
24.180 + {
24.181 + // No error checking is done, assume the catalog exists and can
24.182 + // be used.
24.183 +- __textdomain(__s.c_str());
24.184 ++ textdomain(__s.c_str());
24.185 + return 0;
24.186 + }
24.187 +
24.188 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
24.189 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:39.000000000 +0200
24.190 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:39.000000000 +0200
24.191 +@@ -43,10 +43,6 @@
24.192 + #warning tailor for stub locale support
24.193 + #endif
24.194 +
24.195 +-#ifndef __UCLIBC_HAS_XLOCALE__
24.196 +-#define __nl_langinfo_l(N, L) nl_langinfo((N))
24.197 +-#endif
24.198 +-
24.199 + namespace std
24.200 + {
24.201 + // Construct and return valid pattern consisting of some combination of:
24.202 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
24.203 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:39.000000000 +0200
24.204 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:39.000000000 +0200
24.205 +@@ -41,9 +41,6 @@
24.206 + #ifdef __UCLIBC_MJN3_ONLY__
24.207 + #warning tailor for stub locale support
24.208 + #endif
24.209 +-#ifndef __UCLIBC_HAS_XLOCALE__
24.210 +-#define __nl_langinfo_l(N, L) nl_langinfo((N))
24.211 +-#endif
24.212 +
24.213 + namespace std
24.214 + {
24.215 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc
24.216 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:39.000000000 +0200
24.217 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:39.000000000 +0200
24.218 +@@ -40,9 +40,6 @@
24.219 + #ifdef __UCLIBC_MJN3_ONLY__
24.220 + #warning tailor for stub locale support
24.221 + #endif
24.222 +-#ifndef __UCLIBC_HAS_XLOCALE__
24.223 +-#define __nl_langinfo_l(N, L) nl_langinfo((N))
24.224 +-#endif
24.225 +
24.226 + namespace std
24.227 + {
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
25.2 +++ b/patches/gcc/4.3.0/700-204-uclibc-locale-wchar_fix.patch Tue Jun 10 22:10:40 2008 +0000
25.3 @@ -0,0 +1,51 @@
25.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
25.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
25.6 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:43.000000000 +0200
25.7 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:43.000000000 +0200
25.8 +@@ -401,7 +401,7 @@
25.9 + # ifdef __UCLIBC_HAS_XLOCALE__
25.10 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
25.11 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
25.12 +-# else
25.13 ++# elif defined __UCLIBC_HAS_LOCALE__
25.14 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
25.15 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
25.16 + # endif
25.17 +@@ -556,7 +556,7 @@
25.18 + # ifdef __UCLIBC_HAS_XLOCALE__
25.19 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
25.20 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
25.21 +-# else
25.22 ++# elif defined __UCLIBC_HAS_LOCALE__
25.23 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
25.24 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
25.25 + # endif
25.26 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
25.27 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:43.000000000 +0200
25.28 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:43.000000000 +0200
25.29 +@@ -127,12 +127,25 @@
25.30 + {
25.31 + // Named locale.
25.32 + // NB: In the GNU model wchar_t is always 32 bit wide.
25.33 ++#ifdef __UCLIBC_MJN3_ONLY__
25.34 ++#warning fix this... should be numeric
25.35 ++#endif
25.36 ++#ifdef __UCLIBC__
25.37 ++# ifdef __UCLIBC_HAS_XLOCALE__
25.38 ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
25.39 ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
25.40 ++# elif defined __UCLIBC_HAS_LOCALE__
25.41 ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
25.42 ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
25.43 ++# endif
25.44 ++#else
25.45 + union { char *__s; wchar_t __w; } __u;
25.46 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
25.47 + _M_data->_M_decimal_point = __u.__w;
25.48 +
25.49 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
25.50 + _M_data->_M_thousands_sep = __u.__w;
25.51 ++#endif
25.52 +
25.53 + if (_M_data->_M_thousands_sep == L'\0')
25.54 + _M_data->_M_grouping = "";
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26.2 +++ b/patches/gcc/4.3.0/725-205-uclibc-locale-update.patch Tue Jun 10 22:10:40 2008 +0000
26.3 @@ -0,0 +1,355 @@
26.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_205-uclibc-locale-update.patch
26.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
26.6 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:43.000000000 +0200
26.7 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:46.000000000 +0200
26.8 +@@ -46,16 +46,13 @@
26.9 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
26.10 + const __c_locale& __cloc)
26.11 + {
26.12 +- if (!(__err & ios_base::failbit))
26.13 +- {
26.14 +- char* __sanity;
26.15 +- errno = 0;
26.16 +- float __f = __strtof_l(__s, &__sanity, __cloc);
26.17 +- if (__sanity != __s && errno != ERANGE)
26.18 +- __v = __f;
26.19 +- else
26.20 +- __err |= ios_base::failbit;
26.21 +- }
26.22 ++ char* __sanity;
26.23 ++ errno = 0;
26.24 ++ float __f = __strtof_l(__s, &__sanity, __cloc);
26.25 ++ if (__sanity != __s && errno != ERANGE)
26.26 ++ __v = __f;
26.27 ++ else
26.28 ++ __err |= ios_base::failbit;
26.29 + }
26.30 +
26.31 + template<>
26.32 +@@ -63,16 +60,13 @@
26.33 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
26.34 + const __c_locale& __cloc)
26.35 + {
26.36 +- if (!(__err & ios_base::failbit))
26.37 +- {
26.38 +- char* __sanity;
26.39 +- errno = 0;
26.40 +- double __d = __strtod_l(__s, &__sanity, __cloc);
26.41 +- if (__sanity != __s && errno != ERANGE)
26.42 +- __v = __d;
26.43 +- else
26.44 +- __err |= ios_base::failbit;
26.45 +- }
26.46 ++ char* __sanity;
26.47 ++ errno = 0;
26.48 ++ double __d = __strtod_l(__s, &__sanity, __cloc);
26.49 ++ if (__sanity != __s && errno != ERANGE)
26.50 ++ __v = __d;
26.51 ++ else
26.52 ++ __err |= ios_base::failbit;
26.53 + }
26.54 +
26.55 + template<>
26.56 +@@ -80,16 +74,13 @@
26.57 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
26.58 + const __c_locale& __cloc)
26.59 + {
26.60 +- if (!(__err & ios_base::failbit))
26.61 +- {
26.62 +- char* __sanity;
26.63 +- errno = 0;
26.64 +- long double __ld = __strtold_l(__s, &__sanity, __cloc);
26.65 +- if (__sanity != __s && errno != ERANGE)
26.66 +- __v = __ld;
26.67 +- else
26.68 +- __err |= ios_base::failbit;
26.69 +- }
26.70 ++ char* __sanity;
26.71 ++ errno = 0;
26.72 ++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
26.73 ++ if (__sanity != __s && errno != ERANGE)
26.74 ++ __v = __ld;
26.75 ++ else
26.76 ++ __err |= ios_base::failbit;
26.77 + }
26.78 +
26.79 + void
26.80 +@@ -110,7 +101,7 @@
26.81 + void
26.82 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
26.83 + {
26.84 +- if (_S_get_c_locale() != __cloc)
26.85 ++ if (__cloc && _S_get_c_locale() != __cloc)
26.86 + __freelocale(__cloc);
26.87 + }
26.88 +
26.89 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
26.90 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:43.000000000 +0200
26.91 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:46.000000000 +0200
26.92 +@@ -39,21 +39,23 @@
26.93 + #pragma GCC system_header
26.94 +
26.95 + #include <cstring> // get std::strlen
26.96 +-#include <cstdio> // get std::snprintf or std::sprintf
26.97 ++#include <cstdio> // get std::vsnprintf or std::vsprintf
26.98 + #include <clocale>
26.99 + #include <langinfo.h> // For codecvt
26.100 + #ifdef __UCLIBC_MJN3_ONLY__
26.101 + #warning fix this
26.102 + #endif
26.103 +-#ifdef __UCLIBC_HAS_LOCALE__
26.104 ++#ifdef _GLIBCXX_USE_ICONV
26.105 + #include <iconv.h> // For codecvt using iconv, iconv_t
26.106 + #endif
26.107 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
26.108 +-#include <libintl.h> // For messages
26.109 ++#ifdef HAVE_LIBINTL_H
26.110 ++#include <libintl.h> // For messages
26.111 + #endif
26.112 ++#include <cstdarg>
26.113 +
26.114 + #ifdef __UCLIBC_MJN3_ONLY__
26.115 + #warning what is _GLIBCXX_C_LOCALE_GNU for
26.116 ++// psm: used in os/gnu-linux/ctype_noninline.h
26.117 + #endif
26.118 + #define _GLIBCXX_C_LOCALE_GNU 1
26.119 +
26.120 +@@ -62,7 +64,7 @@
26.121 + #endif
26.122 + // #define _GLIBCXX_NUM_CATEGORIES 6
26.123 + #define _GLIBCXX_NUM_CATEGORIES 0
26.124 +-
26.125 ++
26.126 + #ifdef __UCLIBC_HAS_XLOCALE__
26.127 + namespace __gnu_cxx
26.128 + {
26.129 +@@ -79,22 +81,24 @@
26.130 + typedef int* __c_locale;
26.131 + #endif
26.132 +
26.133 +- // Convert numeric value of type _Tv to string and return length of
26.134 +- // string. If snprintf is available use it, otherwise fall back to
26.135 +- // the unsafe sprintf which, in general, can be dangerous and should
26.136 ++ // Convert numeric value of type double to string and return length of
26.137 ++ // string. If vsnprintf is available use it, otherwise fall back to
26.138 ++ // the unsafe vsprintf which, in general, can be dangerous and should
26.139 + // be avoided.
26.140 +- template<typename _Tv>
26.141 +- int
26.142 +- __convert_from_v(char* __out,
26.143 +- const int __size __attribute__ ((__unused__)),
26.144 +- const char* __fmt,
26.145 +-#ifdef __UCLIBC_HAS_XCLOCALE__
26.146 +- _Tv __v, const __c_locale& __cloc, int __prec)
26.147 ++ inline int
26.148 ++ __convert_from_v(const __c_locale&
26.149 ++#ifndef __UCLIBC_HAS_XCLOCALE__
26.150 ++ __cloc __attribute__ ((__unused__))
26.151 ++#endif
26.152 ++ ,
26.153 ++ char* __out,
26.154 ++ const int __size,
26.155 ++ const char* __fmt, ...)
26.156 + {
26.157 ++ va_list __args;
26.158 ++#ifdef __UCLIBC_HAS_XCLOCALE__
26.159 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
26.160 + #else
26.161 +- _Tv __v, const __c_locale&, int __prec)
26.162 +- {
26.163 + # ifdef __UCLIBC_HAS_LOCALE__
26.164 + char* __old = std::setlocale(LC_ALL, NULL);
26.165 + char* __sav = new char[std::strlen(__old) + 1];
26.166 +@@ -103,7 +107,9 @@
26.167 + # endif
26.168 + #endif
26.169 +
26.170 +- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
26.171 ++ va_start(__args, __fmt);
26.172 ++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
26.173 ++ va_end(__args);
26.174 +
26.175 + #ifdef __UCLIBC_HAS_XCLOCALE__
26.176 + __gnu_cxx::__uselocale(__old);
26.177 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
26.178 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:43.000000000 +0200
26.179 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:46.000000000 +0200
26.180 +@@ -33,9 +33,14 @@
26.181 +
26.182 + // Written by Benjamin Kosnik <bkoz@redhat.com>
26.183 +
26.184 ++#include <features.h>
26.185 ++#ifdef __UCLIBC_HAS_LOCALE__
26.186 + #define _LIBC
26.187 + #include <locale>
26.188 + #undef _LIBC
26.189 ++#else
26.190 ++#include <locale>
26.191 ++#endif
26.192 + #include <bits/c++locale_internal.h>
26.193 +
26.194 + namespace std
26.195 +@@ -138,20 +143,34 @@
26.196 + ctype<wchar_t>::
26.197 + do_is(mask __m, wchar_t __c) const
26.198 + {
26.199 +- // Highest bitmask in ctype_base == 10, but extra in "C"
26.200 +- // library for blank.
26.201 ++ // The case of __m == ctype_base::space is particularly important,
26.202 ++ // due to its use in many istream functions. Therefore we deal with
26.203 ++ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
26.204 ++ // is the mask corresponding to ctype_base::space. NB: an encoding
26.205 ++ // change would not affect correctness!
26.206 + bool __ret = false;
26.207 +- const size_t __bitmasksize = 11;
26.208 +- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
26.209 +- if (__m & _M_bit[__bitcur]
26.210 +- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
26.211 +- {
26.212 +- __ret = true;
26.213 +- break;
26.214 +- }
26.215 ++ if (__m == _M_bit[5])
26.216 ++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
26.217 ++ else
26.218 ++ {
26.219 ++ // Highest bitmask in ctype_base == 10, but extra in "C"
26.220 ++ // library for blank.
26.221 ++ const size_t __bitmasksize = 11;
26.222 ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
26.223 ++ if (__m & _M_bit[__bitcur])
26.224 ++ {
26.225 ++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
26.226 ++ {
26.227 ++ __ret = true;
26.228 ++ break;
26.229 ++ }
26.230 ++ else if (__m == _M_bit[__bitcur])
26.231 ++ break;
26.232 ++ }
26.233 ++ }
26.234 + return __ret;
26.235 + }
26.236 +-
26.237 ++
26.238 + const wchar_t*
26.239 + ctype<wchar_t>::
26.240 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
26.241 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
26.242 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:43.000000000 +0200
26.243 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:46.000000000 +0200
26.244 +@@ -47,18 +47,21 @@
26.245 + template<typename _CharT>
26.246 + messages<_CharT>::messages(size_t __refs)
26.247 + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
26.248 +- _M_name_messages(_S_get_c_name())
26.249 ++ _M_name_messages(_S_get_c_name())
26.250 + { }
26.251 +
26.252 + template<typename _CharT>
26.253 + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
26.254 + size_t __refs)
26.255 +- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
26.256 +- _M_name_messages(__s)
26.257 ++ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
26.258 + {
26.259 +- char* __tmp = new char[std::strlen(__s) + 1];
26.260 +- std::strcpy(__tmp, __s);
26.261 ++ const size_t __len = std::strlen(__s) + 1;
26.262 ++ char* __tmp = new char[__len];
26.263 ++ std::memcpy(__tmp, __s, __len);
26.264 + _M_name_messages = __tmp;
26.265 ++
26.266 ++ // Last to avoid leaking memory if new throws.
26.267 ++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
26.268 + }
26.269 +
26.270 + template<typename _CharT>
26.271 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
26.272 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:46.000000000 +0200
26.273 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:46.000000000 +0200
26.274 +@@ -33,9 +33,14 @@
26.275 +
26.276 + // Written by Benjamin Kosnik <bkoz@redhat.com>
26.277 +
26.278 ++#include <features.h>
26.279 ++#ifdef __UCLIBC_HAS_LOCALE__
26.280 + #define _LIBC
26.281 + #include <locale>
26.282 + #undef _LIBC
26.283 ++#else
26.284 ++#include <locale>
26.285 ++#endif
26.286 + #include <bits/c++locale_internal.h>
26.287 +
26.288 + #ifdef __UCLIBC_MJN3_ONLY__
26.289 +@@ -206,7 +211,7 @@
26.290 + }
26.291 + break;
26.292 + default:
26.293 +- ;
26.294 ++ __ret = pattern();
26.295 + }
26.296 + return __ret;
26.297 + }
26.298 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
26.299 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:46.000000000 +0200
26.300 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:46.000000000 +0200
26.301 +@@ -33,9 +33,14 @@
26.302 +
26.303 + // Written by Benjamin Kosnik <bkoz@redhat.com>
26.304 +
26.305 ++#include <features.h>
26.306 ++#ifdef __UCLIBC_HAS_LOCALE__
26.307 + #define _LIBC
26.308 + #include <locale>
26.309 + #undef _LIBC
26.310 ++#else
26.311 ++#include <locale>
26.312 ++#endif
26.313 + #include <bits/c++locale_internal.h>
26.314 +
26.315 + #ifdef __UCLIBC_MJN3_ONLY__
26.316 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
26.317 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:39.000000000 +0200
26.318 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:46.000000000 +0200
26.319 +@@ -37,25 +37,33 @@
26.320 + template<typename _CharT>
26.321 + __timepunct<_CharT>::__timepunct(size_t __refs)
26.322 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
26.323 +- _M_name_timepunct(_S_get_c_name())
26.324 ++ _M_name_timepunct(_S_get_c_name())
26.325 + { _M_initialize_timepunct(); }
26.326 +
26.327 + template<typename _CharT>
26.328 + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
26.329 + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
26.330 +- _M_name_timepunct(_S_get_c_name())
26.331 ++ _M_name_timepunct(_S_get_c_name())
26.332 + { _M_initialize_timepunct(); }
26.333 +
26.334 + template<typename _CharT>
26.335 + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
26.336 + size_t __refs)
26.337 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
26.338 +- _M_name_timepunct(__s)
26.339 ++ _M_name_timepunct(NULL)
26.340 + {
26.341 +- char* __tmp = new char[std::strlen(__s) + 1];
26.342 +- std::strcpy(__tmp, __s);
26.343 ++ const size_t __len = std::strlen(__s) + 1;
26.344 ++ char* __tmp = new char[__len];
26.345 ++ std::memcpy(__tmp, __s, __len);
26.346 + _M_name_timepunct = __tmp;
26.347 +- _M_initialize_timepunct(__cloc);
26.348 ++
26.349 ++ try
26.350 ++ { _M_initialize_timepunct(__cloc); }
26.351 ++ catch(...)
26.352 ++ {
26.353 ++ delete [] _M_name_timepunct;
26.354 ++ __throw_exception_again;
26.355 ++ }
26.356 + }
26.357 +
26.358 + template<typename _CharT>
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
27.2 +++ b/patches/gcc/4.3.0/750-301-missing-execinfo_h.patch Tue Jun 10 22:10:40 2008 +0000
27.3 @@ -0,0 +1,13 @@
27.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_301-missing-execinfo_h.patch
27.5 +diff -durN gcc-4.3.0.orig/boehm-gc/include/gc.h gcc-4.3.0/boehm-gc/include/gc.h
27.6 +--- gcc-4.3.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
27.7 ++++ gcc-4.3.0/boehm-gc/include/gc.h 2008-06-10 14:45:50.000000000 +0200
27.8 +@@ -503,7 +503,7 @@
27.9 + #if defined(__linux__) || defined(__GLIBC__)
27.10 + # include <features.h>
27.11 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
27.12 +- && !defined(__ia64__)
27.13 ++ && !defined(__ia64__) && !defined(__UCLIBC__)
27.14 + # ifndef GC_HAVE_BUILTIN_BACKTRACE
27.15 + # define GC_HAVE_BUILTIN_BACKTRACE
27.16 + # endif
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28.2 +++ b/patches/gcc/4.3.0/775-303-c99-complex-ugly-hack.patch Tue Jun 10 22:10:40 2008 +0000
28.3 @@ -0,0 +1,14 @@
28.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_303-c99-complex-ugly-hack.patch
28.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
28.6 +--- gcc-4.3.0.orig/libstdc++-v3/configure 2008-06-10 14:45:39.000000000 +0200
28.7 ++++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:54.000000000 +0200
28.8 +@@ -39006,6 +39006,9 @@
28.9 + cat >>conftest.$ac_ext <<_ACEOF
28.10 + /* end confdefs.h. */
28.11 + #include <complex.h>
28.12 ++#ifdef __UCLIBC__
28.13 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
28.14 ++#endif
28.15 + int
28.16 + main ()
28.17 + {
29.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
29.2 +++ b/patches/gcc/4.3.0/800-304-index_macro.patch Tue Jun 10 22:10:40 2008 +0000
29.3 @@ -0,0 +1,27 @@
29.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_304-index_macro.patch
29.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/rope gcc-4.3.0/libstdc++-v3/include/ext/rope
29.6 +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100
29.7 ++++ gcc-4.3.0/libstdc++-v3/include/ext/rope 2008-06-10 14:45:58.000000000 +0200
29.8 +@@ -59,6 +59,9 @@
29.9 + #include <bits/gthr.h>
29.10 + #include <tr1/functional>
29.11 +
29.12 ++/* cope w/ index defined as macro, SuSv3 proposal */
29.13 ++#undef index
29.14 ++
29.15 + # ifdef __GC
29.16 + # define __GC_CONST const
29.17 + # else
29.18 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h
29.19 +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200
29.20 ++++ gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:45:58.000000000 +0200
29.21 +@@ -54,6 +54,9 @@
29.22 + #include <ext/memory> // For uninitialized_copy_n
29.23 + #include <ext/numeric> // For power
29.24 +
29.25 ++/* cope w/ index defined as macro, SuSv3 proposal */
29.26 ++#undef index
29.27 ++
29.28 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
29.29 +
29.30 + using std::size_t;
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
30.2 +++ b/patches/gcc/4.3.0/825-305-libmudflap-susv3-legacy.patch Tue Jun 10 22:10:40 2008 +0000
30.3 @@ -0,0 +1,49 @@
30.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_305-libmudflap-susv3-legacy.patch
30.5 +diff -durN gcc-4.3.0.orig/libmudflap/mf-hooks2.c gcc-4.3.0/libmudflap/mf-hooks2.c
30.6 +--- gcc-4.3.0.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
30.7 ++++ gcc-4.3.0/libmudflap/mf-hooks2.c 2008-06-10 14:46:02.000000000 +0200
30.8 +@@ -427,7 +427,7 @@
30.9 + {
30.10 + TRACE ("%s\n", __PRETTY_FUNCTION__);
30.11 + MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
30.12 +- bzero (s, n);
30.13 ++ memset (s, 0, n);
30.14 + }
30.15 +
30.16 +
30.17 +@@ -437,7 +437,7 @@
30.18 + TRACE ("%s\n", __PRETTY_FUNCTION__);
30.19 + MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
30.20 + MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
30.21 +- bcopy (src, dest, n);
30.22 ++ memmove (dest, src, n);
30.23 + }
30.24 +
30.25 +
30.26 +@@ -447,7 +447,7 @@
30.27 + TRACE ("%s\n", __PRETTY_FUNCTION__);
30.28 + MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
30.29 + MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
30.30 +- return bcmp (s1, s2, n);
30.31 ++ return memcmp (s1, s2, n);
30.32 + }
30.33 +
30.34 +
30.35 +@@ -456,7 +456,7 @@
30.36 + size_t n = strlen (s);
30.37 + TRACE ("%s\n", __PRETTY_FUNCTION__);
30.38 + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
30.39 +- return index (s, c);
30.40 ++ return strchr (s, c);
30.41 + }
30.42 +
30.43 +
30.44 +@@ -465,7 +465,7 @@
30.45 + size_t n = strlen (s);
30.46 + TRACE ("%s\n", __PRETTY_FUNCTION__);
30.47 + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
30.48 +- return rindex (s, c);
30.49 ++ return strrchr (s, c);
30.50 + }
30.51 +
30.52 + /* XXX: stpcpy, memccpy */
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
31.2 +++ b/patches/gcc/4.3.0/850-306-libstdc++-namespace.patch Tue Jun 10 22:10:40 2008 +0000
31.3 @@ -0,0 +1,38 @@
31.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_306-libstdc++-namespace.patch
31.5 +diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
31.6 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
31.7 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:50.000000000 +0200
31.8 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:46:05.000000000 +0200
31.9 +@@ -32,7 +32,8 @@
31.10 + //
31.11 +
31.12 + // Written by Benjamin Kosnik <bkoz@redhat.com>
31.13 +-
31.14 ++namespace std
31.15 ++{
31.16 + #ifdef __UCLIBC_MJN3_ONLY__
31.17 + #warning fix prototypes for *textdomain funcs
31.18 + #endif
31.19 +@@ -115,3 +116,4 @@
31.20 + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
31.21 + }
31.22 + }
31.23 ++}
31.24 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
31.25 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:50.000000000 +0200
31.26 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:46:05.000000000 +0200
31.27 +@@ -33,7 +33,8 @@
31.28 + //
31.29 +
31.30 + // Written by Benjamin Kosnik <bkoz@redhat.com>
31.31 +-
31.32 ++namespace std
31.33 ++{
31.34 + template<typename _CharT>
31.35 + __timepunct<_CharT>::__timepunct(size_t __refs)
31.36 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
31.37 +@@ -74,3 +75,4 @@
31.38 + delete _M_data;
31.39 + _S_destroy_c_locale(_M_c_locale_timepunct);
31.40 + }
31.41 ++}
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
32.2 +++ b/patches/gcc/4.3.1/100-gcc-4.1-alpha-mieee-default.patch Tue Jun 10 22:10:40 2008 +0000
32.3 @@ -0,0 +1,34 @@
32.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
32.5 +Set the default behavior on alpha to use -mieee since the large majority of
32.6 +time we want this (bad/weird things can happen with packages built without
32.7 +-mieee).
32.8 +
32.9 +To satisfy those people who may not want -mieee forced on them all the time,
32.10 +we also provide -mno-ieee.
32.11 +
32.12 +Patch by Mike Frysinger <vapier@gentoo.org>
32.13 +
32.14 +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.h gcc-4.3.1/gcc/config/alpha/alpha.h
32.15 +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.h 2007-12-06 14:25:37.000000000 +0100
32.16 ++++ gcc-4.3.1/gcc/config/alpha/alpha.h 2008-06-10 14:56:36.000000000 +0200
32.17 +@@ -95,6 +95,8 @@
32.18 + while (0)
32.19 + #endif
32.20 +
32.21 ++#define CPP_SPEC "%{!no-ieee:-mieee}"
32.22 ++
32.23 + #define WORD_SWITCH_TAKES_ARG(STR) \
32.24 + (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
32.25 +
32.26 +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.opt gcc-4.3.1/gcc/config/alpha/alpha.opt
32.27 +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200
32.28 ++++ gcc-4.3.1/gcc/config/alpha/alpha.opt 2008-06-10 14:56:36.000000000 +0200
32.29 +@@ -39,7 +39,7 @@
32.30 + Request IEEE-conformant math library routines (OSF/1)
32.31 +
32.32 + mieee
32.33 +-Target Report RejectNegative Mask(IEEE)
32.34 ++Target Report Mask(IEEE)
32.35 + Emit IEEE-conformant code, without inexact exceptions
32.36 +
32.37 + mieee-with-inexact
33.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
33.2 +++ b/patches/gcc/4.3.1/125-gcc-trampolinewarn.patch Tue Jun 10 22:10:40 2008 +0000
33.3 @@ -0,0 +1,35 @@
33.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch
33.5 + This trivial patch causes gcc to emit a warning whenever
33.6 + it generates a trampoline. These are otherwise hard to
33.7 + locate. It is rigged to default ON - to have it default
33.8 + to OFF remove the text 'Init(1)' from the common.opt
33.9 + patch, leaving just 'Common Var(warn_trampolines)'.
33.10 + Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
33.11 +
33.12 +diff -durN gcc-4.3.1.orig/gcc/builtins.c gcc-4.3.1/gcc/builtins.c
33.13 +--- gcc-4.3.1.orig/gcc/builtins.c 2008-04-23 00:36:27.000000000 +0200
33.14 ++++ gcc-4.3.1/gcc/builtins.c 2008-06-10 14:56:54.000000000 +0200
33.15 +@@ -5662,6 +5662,9 @@
33.16 + trampolines_created = 1;
33.17 + INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
33.18 +
33.19 ++ if (warn_trampolines)
33.20 ++ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
33.21 ++
33.22 + return const0_rtx;
33.23 + }
33.24 +
33.25 +diff -durN gcc-4.3.1.orig/gcc/common.opt gcc-4.3.1/gcc/common.opt
33.26 +--- gcc-4.3.1.orig/gcc/common.opt 2008-01-22 15:11:44.000000000 +0100
33.27 ++++ gcc-4.3.1/gcc/common.opt 2008-06-10 14:56:54.000000000 +0200
33.28 +@@ -182,6 +182,10 @@
33.29 + Common Var(warn_system_headers) Warning
33.30 + Do not suppress warnings from system headers
33.31 +
33.32 ++Wtrampolines
33.33 ++Common Var(warn_trampolines) Init(1)
33.34 ++Warn whenever a trampoline is generated
33.35 ++
33.36 + Wuninitialized
33.37 + Common Var(warn_uninitialized) Warning
33.38 + Warn about uninitialized automatic variables
34.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
34.2 +++ b/patches/gcc/4.3.1/150-gcc43-java-nomulti.patch Tue Jun 10 22:10:40 2008 +0000
34.3 @@ -0,0 +1,47 @@
34.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/03_all_gcc43-java-nomulti.patch
34.5 +diff -durN gcc-4.3.1.orig/libjava/configure gcc-4.3.1/libjava/configure
34.6 +--- gcc-4.3.1.orig/libjava/configure 2008-06-06 16:49:11.000000000 +0200
34.7 ++++ gcc-4.3.1/libjava/configure 2008-06-10 14:57:38.000000000 +0200
34.8 +@@ -1018,6 +1018,8 @@
34.9 + --enable-gconf-peer compile GConf native peers for util.preferences
34.10 + --enable-java-maintainer-mode
34.11 + allow rebuilding of .class and .h files
34.12 ++ --enable-libjava-multilib
34.13 ++ build libjava as multilib
34.14 + --disable-dependency-tracking speeds up one-time build
34.15 + --enable-dependency-tracking do not reject slow dependency extractors
34.16 + --enable-maintainer-mode enable make rules and dependencies not useful
34.17 +@@ -1850,6 +1852,16 @@
34.18 + fi
34.19 +
34.20 +
34.21 ++# Check whether --enable-libjava-multilib was given.
34.22 ++if test "${enable_libjava_multilib+set}" = set; then
34.23 ++ enableval=$enable_libjava_multilib;
34.24 ++fi
34.25 ++
34.26 ++if test "$enable_libjava_multilib" = no; then
34.27 ++ multilib=no
34.28 ++ ac_configure_args="$ac_configure_args --disable-multilib"
34.29 ++fi
34.30 ++
34.31 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
34.32 +
34.33 +
34.34 +diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
34.35 +--- gcc-4.3.1.orig/libjava/configure.ac 2007-12-22 16:48:46.000000000 +0100
34.36 ++++ gcc-4.3.1/libjava/configure.ac 2008-06-10 14:57:38.000000000 +0200
34.37 +@@ -82,6 +82,13 @@
34.38 + [allow rebuilding of .class and .h files]))
34.39 + AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
34.40 +
34.41 ++AC_ARG_ENABLE(libjava-multilib,
34.42 ++ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
34.43 ++if test "$enable_libjava_multilib" = no; then
34.44 ++ multilib=no
34.45 ++ ac_configure_args="$ac_configure_args --disable-multilib"
34.46 ++fi
34.47 ++
34.48 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
34.49 + GCC_NO_EXECUTABLES
34.50 +
35.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
35.2 +++ b/patches/gcc/4.3.1/175-gcc-4.1-cross-compile.patch Tue Jun 10 22:10:40 2008 +0000
35.3 @@ -0,0 +1,44 @@
35.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch
35.5 +Some notes on the 'bootstrap with or without libc headers' debate:
35.6 +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
35.7 +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
35.8 +
35.9 +diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure
35.10 +--- gcc-4.3.1.orig/gcc/configure 2008-05-21 10:54:15.000000000 +0200
35.11 ++++ gcc-4.3.1/gcc/configure 2008-06-10 14:57:42.000000000 +0200
35.12 +@@ -13283,7 +13283,7 @@
35.13 + | powerpc*-*-*,powerpc64*-*-*)
35.14 + CROSS="$CROSS -DNATIVE_CROSS" ;;
35.15 + esac
35.16 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
35.17 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
35.18 + SYSTEM_HEADER_DIR=$build_system_header_dir
35.19 + fi
35.20 +
35.21 +diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac
35.22 +--- gcc-4.3.1.orig/gcc/configure.ac 2008-05-21 10:54:15.000000000 +0200
35.23 ++++ gcc-4.3.1/gcc/configure.ac 2008-06-10 14:57:42.000000000 +0200
35.24 +@@ -1749,7 +1749,7 @@
35.25 + | powerpc*-*-*,powerpc64*-*-*)
35.26 + CROSS="$CROSS -DNATIVE_CROSS" ;;
35.27 + esac
35.28 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
35.29 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
35.30 + SYSTEM_HEADER_DIR=$build_system_header_dir
35.31 + fi
35.32 +
35.33 +diff -durN gcc-4.3.1.orig/gcc/unwind-dw2.c gcc-4.3.1/gcc/unwind-dw2.c
35.34 +--- gcc-4.3.1.orig/gcc/unwind-dw2.c 2007-07-25 20:14:57.000000000 +0200
35.35 ++++ gcc-4.3.1/gcc/unwind-dw2.c 2008-06-10 14:57:42.000000000 +0200
35.36 +@@ -334,9 +334,11 @@
35.37 + }
35.38 + #endif
35.39 +
35.40 ++#ifndef inhibit_libc
35.41 + #ifdef MD_UNWIND_SUPPORT
35.42 + #include MD_UNWIND_SUPPORT
35.43 + #endif
35.44 ++#endif
35.45 +
35.46 + /* Extract any interesting information from the CIE for the translation
35.47 + unit F belongs to. Return a pointer to the byte after the augmentation,
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
36.2 +++ b/patches/gcc/4.3.1/200-gcc-netbsd-symbolic.patch Tue Jun 10 22:10:40 2008 +0000
36.3 @@ -0,0 +1,14 @@
36.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/11_all_gcc-netbsd-symbolic.patch
36.5 +http://bugs.gentoo.org/122698
36.6 +
36.7 +diff -durN gcc-4.3.1.orig/gcc/config/netbsd-elf.h gcc-4.3.1/gcc/config/netbsd-elf.h
36.8 +--- gcc-4.3.1.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200
36.9 ++++ gcc-4.3.1/gcc/config/netbsd-elf.h 2008-06-10 14:57:48.000000000 +0200
36.10 +@@ -82,6 +82,7 @@
36.11 + #define NETBSD_LINK_SPEC_ELF \
36.12 + "%{assert*} %{R*} %{rpath*} \
36.13 + %{shared:-shared} \
36.14 ++ %{symbolic:-Bsymbolic} \
36.15 + %{!shared: \
36.16 + -dc -dp \
36.17 + %{!nostdlib: \
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
37.2 +++ b/patches/gcc/4.3.1/225-gcc-sparc64-bsd.patch Tue Jun 10 22:10:40 2008 +0000
37.3 @@ -0,0 +1,30 @@
37.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/14_all_gcc-sparc64-bsd.patch
37.5 +diff -durN gcc-4.3.1.orig/gcc/config/sparc/freebsd.h gcc-4.3.1/gcc/config/sparc/freebsd.h
37.6 +--- gcc-4.3.1.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200
37.7 ++++ gcc-4.3.1/gcc/config/sparc/freebsd.h 2008-06-10 14:57:54.000000000 +0200
37.8 +@@ -25,9 +25,22 @@
37.9 + /* FreeBSD needs the platform name (sparc64) defined.
37.10 + Emacs needs to know if the arch is 64 or 32-bits. */
37.11 +
37.12 +-#undef CPP_CPU64_DEFAULT_SPEC
37.13 +-#define CPP_CPU64_DEFAULT_SPEC \
37.14 +- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
37.15 ++#undef FBSD_TARGET_CPU_CPP_BUILTINS
37.16 ++#define FBSD_TARGET_CPU_CPP_BUILTINS() \
37.17 ++ do \
37.18 ++ { \
37.19 ++ if (TARGET_ARCH64) \
37.20 ++ { \
37.21 ++ builtin_define ("__sparc64__"); \
37.22 ++ builtin_define ("__sparc_v9__"); \
37.23 ++ builtin_define ("__sparcv9"); \
37.24 ++ } \
37.25 ++ else \
37.26 ++ builtin_define ("__sparc"); \
37.27 ++ builtin_define ("__sparc__"); \
37.28 ++ } \
37.29 ++ while (0)
37.30 ++
37.31 +
37.32 + #define LINK_SPEC "%(link_arch) \
37.33 + %{!mno-relax:%{!r:-relax}} \
38.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
38.2 +++ b/patches/gcc/4.3.1/250-904-flatten-switch-stmt-00.patch Tue Jun 10 22:10:40 2008 +0000
38.3 @@ -0,0 +1,76 @@
38.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/18_all_904-flatten-switch-stmt-00.patch
38.5 +http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
38.6 +
38.7 +Hi,
38.8 +
38.9 +The attached patch makes sure that we create smaller object code for
38.10 +simple switch statements. We just make sure to flatten the switch
38.11 +statement into an if-else chain, basically.
38.12 +
38.13 +This fixes a size-regression as compared to gcc-3.4, as can be seen
38.14 +below.
38.15 +
38.16 +2007-04-15 Bernhard Fischer <..>
38.17 +
38.18 + * stmt.c (expand_case): Do not create a complex binary tree when
38.19 + optimizing for size but rather use the simple ordered list.
38.20 + (emit_case_nodes): do not emit jumps to the default_label when
38.21 + optimizing for size.
38.22 +
38.23 +Not regtested so far.
38.24 +Comments?
38.25 +
38.26 +Attached is the test switch.c mentioned below.
38.27 +
38.28 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
38.29 +gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
38.30 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
38.31 +gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
38.32 +
38.33 +$ size switch-*.o
38.34 + text data bss dec hex filename
38.35 + 169 0 0 169 a9 switch-2.95.o
38.36 + 115 0 0 115 73 switch-3.3.o
38.37 + 103 0 0 103 67 switch-3.4.o
38.38 + 124 0 0 124 7c switch-4.0.o
38.39 + 124 0 0 124 7c switch-4.1.o
38.40 + 124 0 0 124 7c switch-4.2.orig-HEAD.o
38.41 + 95 0 0 95 5f switch-4.3-HEAD.o
38.42 + 124 0 0 124 7c switch-4.3.orig-HEAD.o
38.43 + 166 0 0 166 a6 switch-CHAIN-2.95.o
38.44 + 111 0 0 111 6f switch-CHAIN-3.3.o
38.45 + 95 0 0 95 5f switch-CHAIN-3.4.o
38.46 + 95 0 0 95 5f switch-CHAIN-4.0.o
38.47 + 95 0 0 95 5f switch-CHAIN-4.1.o
38.48 + 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
38.49 + 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
38.50 + 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
38.51 +
38.52 +
38.53 +Content-Type: text/x-diff; charset=us-ascii
38.54 +Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
38.55 +
38.56 +diff -durN gcc-4.3.1.orig/gcc/stmt.c gcc-4.3.1/gcc/stmt.c
38.57 +--- gcc-4.3.1.orig/gcc/stmt.c 2008-05-09 20:12:13.000000000 +0200
38.58 ++++ gcc-4.3.1/gcc/stmt.c 2008-06-10 14:57:58.000000000 +0200
38.59 +@@ -2509,7 +2509,11 @@
38.60 + use_cost_table
38.61 + = (TREE_CODE (orig_type) != ENUMERAL_TYPE
38.62 + && estimate_case_costs (case_list));
38.63 +- balance_case_nodes (&case_list, NULL);
38.64 ++ /* When optimizing for size, we want a straight list to avoid
38.65 ++ jumps as much as possible. This basically creates an if-else
38.66 ++ chain. */
38.67 ++ if (!optimize_size)
38.68 ++ balance_case_nodes (&case_list, NULL);
38.69 + emit_case_nodes (index, case_list, default_label, index_type);
38.70 + emit_jump (default_label);
38.71 + }
38.72 +@@ -3067,6 +3071,7 @@
38.73 + {
38.74 + if (!node_has_low_bound (node, index_type))
38.75 + {
38.76 ++ if (!optimize_size) /* don't jl to the .default_label. */
38.77 + emit_cmp_and_jump_insns (index,
38.78 + convert_modes
38.79 + (mode, imode,
39.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
39.2 +++ b/patches/gcc/4.3.1/275-gcc-3.4-libiberty-pic.patch Tue Jun 10 22:10:40 2008 +0000
39.3 @@ -0,0 +1,12 @@
39.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/51_all_gcc-3.4-libiberty-pic.patch
39.5 +diff -durN gcc-4.3.1.orig/libiberty/Makefile.in gcc-4.3.1/libiberty/Makefile.in
39.6 +--- gcc-4.3.1.orig/libiberty/Makefile.in 2007-07-25 08:26:45.000000000 +0200
39.7 ++++ gcc-4.3.1/libiberty/Makefile.in 2008-06-10 14:58:02.000000000 +0200
39.8 +@@ -225,6 +225,7 @@
39.9 + $(AR) $(AR_FLAGS) $(TARGETLIB) \
39.10 + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
39.11 + $(RANLIB) $(TARGETLIB); \
39.12 ++ cp $(TARGETLIB) ../ ; \
39.13 + cd ..; \
39.14 + else true; fi
39.15 +
40.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
40.2 +++ b/patches/gcc/4.3.1/300-gcc4-superh-default-multilib.patch Tue Jun 10 22:10:40 2008 +0000
40.3 @@ -0,0 +1,25 @@
40.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/53_all_gcc4-superh-default-multilib.patch
40.5 +The gcc-3.x toolchains would contain all the targets by default. With gcc-4,
40.6 +you have to actually list out the multilibs you want or you will end up with
40.7 +just one when using targets like 'sh4-linux-gnu'.
40.8 +
40.9 +The resulting toolchain can't even build a kernel as the kernel needs to build
40.10 +with the nofpu flag to be sure that no fpu ops are generated.
40.11 +
40.12 +Here we restore the gcc-3.x behavior; the additional overhead of building all
40.13 +of these multilibs by default is negligible.
40.14 +
40.15 +http://bugs.gentoo.org/140205
40.16 +
40.17 +diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
40.18 +--- gcc-4.3.1.orig/gcc/config.gcc 2008-05-21 10:54:15.000000000 +0200
40.19 ++++ gcc-4.3.1/gcc/config.gcc 2008-06-10 14:58:06.000000000 +0200
40.20 +@@ -2278,7 +2278,7 @@
40.21 + if test x${sh_multilibs} = x ; then
40.22 + case ${target} in
40.23 + sh64-superh-linux* | \
40.24 +- sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
40.25 ++ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
40.26 + sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
40.27 + sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
40.28 + sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;;
41.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
41.2 +++ b/patches/gcc/4.3.1/325-300-libstdc++-pic.patch Tue Jun 10 22:10:40 2008 +0000
41.3 @@ -0,0 +1,56 @@
41.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch
41.5 +install libstdc++_pic.a if we have pic objs
41.6 +
41.7 +diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am gcc-4.3.1/libstdc++-v3/src/Makefile.am
41.8 +--- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am 2008-02-29 19:26:50.000000000 +0100
41.9 ++++ gcc-4.3.1/libstdc++-v3/src/Makefile.am 2008-06-10 14:58:09.000000000 +0200
41.10 +@@ -289,6 +289,13 @@
41.11 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
41.12 +
41.13 +
41.14 ++install-exec-local:
41.15 ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
41.16 ++ if [ x"$$pic_objs" != x ]; then \
41.17 ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
41.18 ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
41.19 ++ fi
41.20 ++
41.21 + # Added bits to build debug library.
41.22 + if GLIBCXX_BUILD_DEBUG
41.23 + all-local: build_debug
41.24 +diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in gcc-4.3.1/libstdc++-v3/src/Makefile.in
41.25 +--- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in 2008-02-29 19:26:50.000000000 +0100
41.26 ++++ gcc-4.3.1/libstdc++-v3/src/Makefile.in 2008-06-10 14:58:09.000000000 +0200
41.27 +@@ -693,7 +693,7 @@
41.28 +
41.29 + install-data-am: install-data-local
41.30 +
41.31 +-install-exec-am: install-toolexeclibLTLIBRARIES
41.32 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
41.33 +
41.34 + install-info: install-info-am
41.35 +
41.36 +@@ -732,7 +732,7 @@
41.37 + maintainer-clean-generic mostlyclean mostlyclean-compile \
41.38 + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
41.39 + tags uninstall uninstall-am uninstall-info-am \
41.40 +- uninstall-toolexeclibLTLIBRARIES
41.41 ++ uninstall-toolexeclibLTLIBRARIES install-exec-local
41.42 +
41.43 +
41.44 + # Symbol versioning for shared libraries.
41.45 +@@ -858,6 +858,14 @@
41.46 + install_debug:
41.47 + (cd ${debugdir} && $(MAKE) \
41.48 + toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
41.49 ++
41.50 ++install-exec-local:
41.51 ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
41.52 ++ if [ x"$$pic_objs" != x ]; then \
41.53 ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
41.54 ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
41.55 ++ fi
41.56 ++
41.57 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
41.58 + # Otherwise a system limit (for SysV at least) may be exceeded.
41.59 + .NOEXPORT:
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
42.2 +++ b/patches/gcc/4.3.1/350-gcc43-pr24170.patch Tue Jun 10 22:10:40 2008 +0000
42.3 @@ -0,0 +1,61 @@
42.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc43-pr24170.patch
42.5 +http://gcc.gnu.org/PR24170
42.6 +
42.7 +2008-02-20 Tom Tromey <tromey@redhat.com>
42.8 +
42.9 + PR libgcj/24170:
42.10 + * java/io/natFilePosix.cc (File::performList): Don't use
42.11 + readdir_r.
42.12 + * configure, include/config.h.in: Rebuilt.
42.13 + * configure.ac: Don't check for readdir_r.
42.14 +
42.15 +diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
42.16 +--- gcc-4.3.1.orig/libjava/configure.ac 2008-06-10 14:57:42.000000000 +0200
42.17 ++++ gcc-4.3.1/libjava/configure.ac 2008-06-10 14:58:13.000000000 +0200
42.18 +@@ -1030,7 +1030,7 @@
42.19 + PLATFORMNET=NoNet
42.20 + else
42.21 + AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
42.22 +- localtime_r readdir_r getpwuid_r getcwd \
42.23 ++ localtime_r getpwuid_r getcwd \
42.24 + access stat lstat mkdir rename rmdir unlink utime chmod readlink \
42.25 + nl_langinfo setlocale \
42.26 + inet_pton uname inet_ntoa \
42.27 +diff -durN gcc-4.3.1.orig/libjava/include/config.h.in gcc-4.3.1/libjava/include/config.h.in
42.28 +--- gcc-4.3.1.orig/libjava/include/config.h.in 2007-07-31 18:17:21.000000000 +0200
42.29 ++++ gcc-4.3.1/libjava/include/config.h.in 2008-06-10 14:58:13.000000000 +0200
42.30 +@@ -214,9 +214,6 @@
42.31 + /* Define to 1 if you have the <pwd.h> header file. */
42.32 + #undef HAVE_PWD_H
42.33 +
42.34 +-/* Define to 1 if you have the `readdir_r' function. */
42.35 +-#undef HAVE_READDIR_R
42.36 +-
42.37 + /* Define to 1 if you have the `readlink' function. */
42.38 + #undef HAVE_READLINK
42.39 +
42.40 +diff -durN gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc gcc-4.3.1/libjava/java/io/natFilePosix.cc
42.41 +--- gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc 2007-08-04 23:50:01.000000000 +0200
42.42 ++++ gcc-4.3.1/libjava/java/io/natFilePosix.cc 2008-06-10 14:58:13.000000000 +0200
42.43 +@@ -1,6 +1,6 @@
42.44 + // natFile.cc - Native part of File class for POSIX.
42.45 +
42.46 +-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
42.47 ++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
42.48 + Free Software Foundation
42.49 +
42.50 + This file is part of libgcj.
42.51 +@@ -292,13 +292,7 @@
42.52 +
42.53 + java::util::ArrayList *list = new java::util::ArrayList ();
42.54 + struct dirent *d;
42.55 +-#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
42.56 +- int name_max = pathconf (buf, _PC_NAME_MAX);
42.57 +- char dbuf[sizeof (struct dirent) + name_max + 1];
42.58 +- while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
42.59 +-#else /* HAVE_READDIR_R */
42.60 + while ((d = readdir (dir)) != NULL)
42.61 +-#endif /* HAVE_READDIR_R */
42.62 + {
42.63 + // Omit "." and "..".
42.64 + if (d->d_name[0] == '.'
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
43.2 +++ b/patches/gcc/4.3.1/375-gcc4-ia64-noteGNUstack.patch Tue Jun 10 22:10:40 2008 +0000
43.3 @@ -0,0 +1,96 @@
43.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
43.5 +2004-09-20 Jakub Jelinek <jakub@redhat.com>
43.6 +
43.7 + * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
43.8 + on ppc64-linux.
43.9 +
43.10 + * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
43.11 + ia64-linux.
43.12 + * config/ia64/crtbegin.asm: Likewise.
43.13 + * config/ia64/crtend.asm: Likewise.
43.14 + * config/ia64/crti.asm: Likewise.
43.15 + * config/ia64/crtn.asm: Likewise.
43.16 +
43.17 +2004-05-14 Jakub Jelinek <jakub@redhat.com>
43.18 +
43.19 + * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
43.20 +
43.21 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.1/gcc/config/ia64/crtbegin.asm
43.22 +--- gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm 2005-09-27 02:52:24.000000000 +0200
43.23 ++++ gcc-4.3.1/gcc/config/ia64/crtbegin.asm 2008-06-10 14:58:17.000000000 +0200
43.24 +@@ -255,3 +255,7 @@
43.25 + .weak __cxa_finalize
43.26 + #endif
43.27 + .weak _Jv_RegisterClasses
43.28 ++
43.29 ++#ifdef __linux__
43.30 ++.section .note.GNU-stack; .previous
43.31 ++#endif
43.32 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtend.asm gcc-4.3.1/gcc/config/ia64/crtend.asm
43.33 +--- gcc-4.3.1.orig/gcc/config/ia64/crtend.asm 2005-09-27 02:52:24.000000000 +0200
43.34 ++++ gcc-4.3.1/gcc/config/ia64/crtend.asm 2008-06-10 14:58:17.000000000 +0200
43.35 +@@ -122,3 +122,7 @@
43.36 +
43.37 + br.ret.sptk.many rp
43.38 + .endp __do_global_ctors_aux
43.39 ++
43.40 ++#ifdef __linux__
43.41 ++.section .note.GNU-stack; .previous
43.42 ++#endif
43.43 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crti.asm gcc-4.3.1/gcc/config/ia64/crti.asm
43.44 +--- gcc-4.3.1.orig/gcc/config/ia64/crti.asm 2005-06-25 03:22:41.000000000 +0200
43.45 ++++ gcc-4.3.1/gcc/config/ia64/crti.asm 2008-06-10 14:58:17.000000000 +0200
43.46 +@@ -64,3 +64,7 @@
43.47 + .body
43.48 +
43.49 + # end of crti.asm
43.50 ++
43.51 ++#ifdef __linux__
43.52 ++.section .note.GNU-stack; .previous
43.53 ++#endif
43.54 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtn.asm gcc-4.3.1/gcc/config/ia64/crtn.asm
43.55 +--- gcc-4.3.1.orig/gcc/config/ia64/crtn.asm 2005-06-25 03:22:41.000000000 +0200
43.56 ++++ gcc-4.3.1/gcc/config/ia64/crtn.asm 2008-06-10 14:58:17.000000000 +0200
43.57 +@@ -54,3 +54,7 @@
43.58 + br.ret.sptk.many b0
43.59 +
43.60 + # end of crtn.asm
43.61 ++
43.62 ++#ifdef __linux__
43.63 ++.section .note.GNU-stack; .previous
43.64 ++#endif
43.65 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.1/gcc/config/ia64/lib1funcs.asm
43.66 +--- gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm 2005-09-27 02:52:24.000000000 +0200
43.67 ++++ gcc-4.3.1/gcc/config/ia64/lib1funcs.asm 2008-06-10 14:58:17.000000000 +0200
43.68 +@@ -792,3 +792,7 @@
43.69 + }
43.70 + .endp __floattitf
43.71 + #endif
43.72 ++
43.73 ++#ifdef __linux__
43.74 ++.section .note.GNU-stack; .previous
43.75 ++#endif
43.76 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/linux.h gcc-4.3.1/gcc/config/ia64/linux.h
43.77 +--- gcc-4.3.1.orig/gcc/config/ia64/linux.h 2006-12-12 16:15:19.000000000 +0100
43.78 ++++ gcc-4.3.1/gcc/config/ia64/linux.h 2008-06-10 14:58:17.000000000 +0200
43.79 +@@ -5,6 +5,8 @@
43.80 +
43.81 + #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
43.82 +
43.83 ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
43.84 ++
43.85 + /* This is for -profile to use -lc_p instead of -lc. */
43.86 + #undef CC1_SPEC
43.87 + #define CC1_SPEC "%{profile:-p} %{G*}"
43.88 +diff -durN gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.1/gcc/config/rs6000/ppc-asm.h
43.89 +--- gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h 2003-06-04 18:44:51.000000000 +0200
43.90 ++++ gcc-4.3.1/gcc/config/rs6000/ppc-asm.h 2008-06-10 14:58:17.000000000 +0200
43.91 +@@ -158,7 +158,7 @@
43.92 + .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
43.93 + #endif
43.94 +
43.95 +-#if defined __linux__ && !defined __powerpc64__
43.96 ++#if defined __linux__
43.97 + .section .note.GNU-stack
43.98 + .previous
43.99 + #endif
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
44.2 +++ b/patches/gcc/4.3.1/400-gcc4-noteGNUstack.patch Tue Jun 10 22:10:40 2008 +0000
44.3 @@ -0,0 +1,198 @@
44.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/62_all_gcc4-noteGNUstack.patch
44.5 +2005-02-08 Jakub Jelinek <jakub@redhat.com>
44.6 +
44.7 + * src/alpha/osf.S: Add .note.GNU-stack on Linux.
44.8 + * src/s390/sysv.S: Likewise.
44.9 + * src/powerpc/linux64.S: Likewise.
44.10 + * src/powerpc/linux64_closure.S: Likewise.
44.11 + * src/powerpc/ppc_closure.S: Likewise.
44.12 + * src/powerpc/sysv.S: Likewise.
44.13 + * src/x86/unix64.S: Likewise.
44.14 + * src/x86/sysv.S: Likewise.
44.15 + * src/sparc/v8.S: Likewise.
44.16 + * src/sparc/v9.S: Likewise.
44.17 + * src/m68k/sysv.S: Likewise.
44.18 + * src/ia64/unix.S: Likewise.
44.19 + * src/arm/sysv.S: Likewise.
44.20 +
44.21 + * ia64_save_regs_in_stack.s: Moved to...
44.22 + * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack
44.23 + on Linux.
44.24 +
44.25 +diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S
44.26 +--- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S 1970-01-01 01:00:00.000000000 +0100
44.27 ++++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S 2008-06-10 14:58:21.000000000 +0200
44.28 +@@ -0,0 +1,15 @@
44.29 ++ .text
44.30 ++ .align 16
44.31 ++ .global GC_save_regs_in_stack
44.32 ++ .proc GC_save_regs_in_stack
44.33 ++GC_save_regs_in_stack:
44.34 ++ .bodyfoo.mpg
44.35 ++ flushrs
44.36 ++ ;;
44.37 ++ mov r8=ar.bsp
44.38 ++ br.ret.sptk.few rp
44.39 ++ .endp GC_save_regs_in_stack
44.40 ++
44.41 ++#ifdef __linux__
44.42 ++ .section .note.GNU-stack,"",@progbits
44.43 ++#endif
44.44 +diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s
44.45 +--- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s 2001-10-15 06:57:59.000000000 +0200
44.46 ++++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s 2008-06-10 14:58:21.000000000 +0200
44.47 +@@ -1,12 +0,0 @@
44.48 +- .text
44.49 +- .align 16
44.50 +- .global GC_save_regs_in_stack
44.51 +- .proc GC_save_regs_in_stack
44.52 +-GC_save_regs_in_stack:
44.53 +- .body
44.54 +- flushrs
44.55 +- ;;
44.56 +- mov r8=ar.bsp
44.57 +- br.ret.sptk.few rp
44.58 +- .endp GC_save_regs_in_stack
44.59 +-
44.60 +diff -durN gcc-4.3.1.orig/libffi/src/alpha/osf.S gcc-4.3.1/libffi/src/alpha/osf.S
44.61 +--- gcc-4.3.1.orig/libffi/src/alpha/osf.S 2007-04-06 18:24:16.000000000 +0200
44.62 ++++ gcc-4.3.1/libffi/src/alpha/osf.S 2008-06-10 14:58:21.000000000 +0200
44.63 +@@ -358,4 +358,8 @@
44.64 + .byte 16 # uleb128 offset 16*-8
44.65 + .align 3
44.66 + $LEFDE3:
44.67 ++
44.68 ++#ifdef __linux__
44.69 ++ .section .note.GNU-stack,"",@progbits
44.70 ++#endif
44.71 + #endif
44.72 +diff -durN gcc-4.3.1.orig/libffi/src/arm/sysv.S gcc-4.3.1/libffi/src/arm/sysv.S
44.73 +--- gcc-4.3.1.orig/libffi/src/arm/sysv.S 2007-09-04 19:52:45.000000000 +0200
44.74 ++++ gcc-4.3.1/libffi/src/arm/sysv.S 2008-06-10 14:58:21.000000000 +0200
44.75 +@@ -293,3 +293,6 @@
44.76 + UNWIND .fnend
44.77 + .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
44.78 +
44.79 ++#if defined __ELF__ && defined __linux__
44.80 ++ .section .note.GNU-stack,"",%progbits
44.81 ++#endif
44.82 +diff -durN gcc-4.3.1.orig/libffi/src/ia64/unix.S gcc-4.3.1/libffi/src/ia64/unix.S
44.83 +--- gcc-4.3.1.orig/libffi/src/ia64/unix.S 2005-03-30 23:49:19.000000000 +0200
44.84 ++++ gcc-4.3.1/libffi/src/ia64/unix.S 2008-06-10 14:58:21.000000000 +0200
44.85 +@@ -553,3 +553,7 @@
44.86 + data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
44.87 + data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
44.88 + data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
44.89 ++
44.90 ++#if defined __ELF__ && defined __linux__
44.91 ++ .section .note.GNU-stack,"",@progbits
44.92 ++#endif
44.93 +diff -durN gcc-4.3.1.orig/libffi/src/m68k/sysv.S gcc-4.3.1/libffi/src/m68k/sysv.S
44.94 +--- gcc-4.3.1.orig/libffi/src/m68k/sysv.S 2007-05-10 23:29:04.000000000 +0200
44.95 ++++ gcc-4.3.1/libffi/src/m68k/sysv.S 2008-06-10 14:58:21.000000000 +0200
44.96 +@@ -207,3 +207,7 @@
44.97 + rts
44.98 + CFI_ENDPROC()
44.99 + .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
44.100 ++
44.101 ++#if defined __ELF__ && defined __linux__
44.102 ++ .section .note.GNU-stack,"",@progbits
44.103 ++#endif
44.104 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64.S gcc-4.3.1/libffi/src/powerpc/linux64.S
44.105 +--- gcc-4.3.1.orig/libffi/src/powerpc/linux64.S 2007-11-17 00:24:53.000000000 +0100
44.106 ++++ gcc-4.3.1/libffi/src/powerpc/linux64.S 2008-06-10 14:58:21.000000000 +0200
44.107 +@@ -179,3 +179,7 @@
44.108 + .align 3
44.109 + .LEFDE1:
44.110 + #endif
44.111 ++
44.112 ++#if defined __ELF__ && defined __linux__
44.113 ++ .section .note.GNU-stack,"",@progbits
44.114 ++#endif
44.115 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.1/libffi/src/powerpc/linux64_closure.S
44.116 +--- gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S 2005-08-11 23:18:24.000000000 +0200
44.117 ++++ gcc-4.3.1/libffi/src/powerpc/linux64_closure.S 2008-06-10 14:58:21.000000000 +0200
44.118 +@@ -204,3 +204,7 @@
44.119 + .align 3
44.120 + .LEFDE1:
44.121 + #endif
44.122 ++
44.123 ++#if defined __ELF__ && defined __linux__
44.124 ++ .section .note.GNU-stack,"",@progbits
44.125 ++#endif
44.126 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.1/libffi/src/powerpc/ppc_closure.S
44.127 +--- gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S 2007-12-01 22:00:04.000000000 +0100
44.128 ++++ gcc-4.3.1/libffi/src/powerpc/ppc_closure.S 2008-06-10 14:58:21.000000000 +0200
44.129 +@@ -295,3 +295,7 @@
44.130 + .LEFDE1:
44.131 +
44.132 + #endif
44.133 ++
44.134 ++#if defined __ELF__ && defined __linux__
44.135 ++ .section .note.GNU-stack,"",@progbits
44.136 ++#endif
44.137 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/sysv.S gcc-4.3.1/libffi/src/powerpc/sysv.S
44.138 +--- gcc-4.3.1.orig/libffi/src/powerpc/sysv.S 2007-12-01 22:00:04.000000000 +0100
44.139 ++++ gcc-4.3.1/libffi/src/powerpc/sysv.S 2008-06-10 14:58:21.000000000 +0200
44.140 +@@ -223,3 +223,7 @@
44.141 + .align 2
44.142 + .LEFDE1:
44.143 + #endif
44.144 ++
44.145 ++#if defined __ELF__ && defined __linux__
44.146 ++ .section .note.GNU-stack,"",@progbits
44.147 ++#endif
44.148 +diff -durN gcc-4.3.1.orig/libffi/src/s390/sysv.S gcc-4.3.1/libffi/src/s390/sysv.S
44.149 +--- gcc-4.3.1.orig/libffi/src/s390/sysv.S 2003-10-21 21:01:58.000000000 +0200
44.150 ++++ gcc-4.3.1/libffi/src/s390/sysv.S 2008-06-10 14:58:21.000000000 +0200
44.151 +@@ -427,3 +427,6 @@
44.152 +
44.153 + #endif
44.154 +
44.155 ++#if defined __ELF__ && defined __linux__
44.156 ++ .section .note.GNU-stack,"",@progbits
44.157 ++#endif
44.158 +diff -durN gcc-4.3.1.orig/libffi/src/sparc/v8.S gcc-4.3.1/libffi/src/sparc/v8.S
44.159 +--- gcc-4.3.1.orig/libffi/src/sparc/v8.S 2004-11-22 19:35:16.000000000 +0100
44.160 ++++ gcc-4.3.1/libffi/src/sparc/v8.S 2008-06-10 14:58:21.000000000 +0200
44.161 +@@ -265,3 +265,7 @@
44.162 + .byte 0x1f ! uleb128 0x1f
44.163 + .align WS
44.164 + .LLEFDE2:
44.165 ++
44.166 ++#if defined __ELF__ && defined __linux__
44.167 ++ .section .note.GNU-stack,"",@progbits
44.168 ++#endif
44.169 +diff -durN gcc-4.3.1.orig/libffi/src/sparc/v9.S gcc-4.3.1/libffi/src/sparc/v9.S
44.170 +--- gcc-4.3.1.orig/libffi/src/sparc/v9.S 2004-01-25 07:58:33.000000000 +0100
44.171 ++++ gcc-4.3.1/libffi/src/sparc/v9.S 2008-06-10 14:58:21.000000000 +0200
44.172 +@@ -300,3 +300,7 @@
44.173 + .align 8
44.174 + .LLEFDE2:
44.175 + #endif
44.176 ++
44.177 ++#ifdef __linux__
44.178 ++ .section .note.GNU-stack,"",@progbits
44.179 ++#endif
44.180 +diff -durN gcc-4.3.1.orig/libffi/src/x86/sysv.S gcc-4.3.1/libffi/src/x86/sysv.S
44.181 +--- gcc-4.3.1.orig/libffi/src/x86/sysv.S 2008-01-30 15:36:58.000000000 +0100
44.182 ++++ gcc-4.3.1/libffi/src/x86/sysv.S 2008-06-10 14:58:21.000000000 +0200
44.183 +@@ -430,3 +430,7 @@
44.184 + #endif
44.185 +
44.186 + #endif /* ifndef __x86_64__ */
44.187 ++
44.188 ++#if defined __ELF__ && defined __linux__
44.189 ++ .section .note.GNU-stack,"",@progbits
44.190 ++#endif
44.191 +diff -durN gcc-4.3.1.orig/libffi/src/x86/unix64.S gcc-4.3.1/libffi/src/x86/unix64.S
44.192 +--- gcc-4.3.1.orig/libffi/src/x86/unix64.S 2005-05-05 06:06:38.000000000 +0200
44.193 ++++ gcc-4.3.1/libffi/src/x86/unix64.S 2008-06-10 14:58:21.000000000 +0200
44.194 +@@ -410,3 +410,7 @@
44.195 + .LEFDE3:
44.196 +
44.197 + #endif /* __x86_64__ */
44.198 ++
44.199 ++#if defined __ELF__ && defined __linux__
44.200 ++ .section .note.GNU-stack,"",@progbits
44.201 ++#endif
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
45.2 +++ b/patches/gcc/4.3.1/425-gcc43-pr34571.patch Tue Jun 10 22:10:40 2008 +0000
45.3 @@ -0,0 +1,35 @@
45.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/64_all_gcc43-pr34571.patch
45.5 +http://gcc.gnu.org/PR34571
45.6 +
45.7 +2007-12-26 Rask Ingemann Lambertsen <rask@sygehus.dk>
45.8 +
45.9 + PR target/34571
45.10 + * config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
45.11 + symbolic_operand.
45.12 + * varasm.c (output_constant_pool_1): Fix typo.
45.13 +
45.14 +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.c gcc-4.3.1/gcc/config/alpha/alpha.c
45.15 +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.c 2008-02-07 18:45:24.000000000 +0100
45.16 ++++ gcc-4.3.1/gcc/config/alpha/alpha.c 2008-06-10 14:58:24.000000000 +0200
45.17 +@@ -1113,8 +1113,7 @@
45.18 + static bool
45.19 + alpha_cannot_force_const_mem (rtx x)
45.20 + {
45.21 +- enum rtx_code code = GET_CODE (x);
45.22 +- return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
45.23 ++ return symbolic_operand (x, GET_MODE (x));
45.24 + }
45.25 +
45.26 + /* We do not allow indirect calls to be optimized into sibling calls, nor
45.27 +diff -durN gcc-4.3.1.orig/gcc/varasm.c gcc-4.3.1/gcc/varasm.c
45.28 +--- gcc-4.3.1.orig/gcc/varasm.c 2007-12-05 22:55:10.000000000 +0100
45.29 ++++ gcc-4.3.1/gcc/varasm.c 2008-06-10 14:58:24.000000000 +0200
45.30 +@@ -3710,7 +3710,7 @@
45.31 + /* FALLTHRU */
45.32 +
45.33 + case LABEL_REF:
45.34 +- tmp = XEXP (x, 0);
45.35 ++ tmp = XEXP (tmp, 0);
45.36 + gcc_assert (!INSN_DELETED_P (tmp));
45.37 + gcc_assert (!NOTE_P (tmp)
45.38 + || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
46.2 +++ b/patches/gcc/4.3.1/450-gcc43-pr25343.patch Tue Jun 10 22:10:40 2008 +0000
46.3 @@ -0,0 +1,21 @@
46.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/66_all_gcc43-pr25343.patch
46.5 +http://gcc.gnu.org/PR25343
46.6 +
46.7 +sniped from Debian
46.8 +
46.9 +2008-04-27 Roman Zippel <zippel@linux-m68k.org>
46.10 +
46.11 + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
46.12 +
46.13 +diff -durN gcc-4.3.1.orig/gcc/config/host-linux.c gcc-4.3.1/gcc/config/host-linux.c
46.14 +--- gcc-4.3.1.orig/gcc/config/host-linux.c 2007-08-02 12:49:31.000000000 +0200
46.15 ++++ gcc-4.3.1/gcc/config/host-linux.c 2008-06-10 14:58:28.000000000 +0200
46.16 +@@ -84,6 +84,8 @@
46.17 + # define TRY_EMPTY_VM_SPACE 0x8000000000
46.18 + #elif defined(__sparc__)
46.19 + # define TRY_EMPTY_VM_SPACE 0x60000000
46.20 ++#elif defined(__mc68000__)
46.21 ++# define TRY_EMPTY_VM_SPACE 0x40000000
46.22 + #else
46.23 + # define TRY_EMPTY_VM_SPACE 0
46.24 + #endif
47.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
47.2 +++ b/patches/gcc/4.3.1/475-sh-pr24836.patch Tue Jun 10 22:10:40 2008 +0000
47.3 @@ -0,0 +1,28 @@
47.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/74_all_sh-pr24836.patch
47.5 +http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
47.6 +http://gcc.gnu.org/PR24836
47.7 +
47.8 +diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure
47.9 +--- gcc-4.3.1.orig/gcc/configure 2008-06-10 14:57:48.000000000 +0200
47.10 ++++ gcc-4.3.1/gcc/configure 2008-06-10 14:58:32.000000000 +0200
47.11 +@@ -14709,7 +14709,7 @@
47.12 + tls_first_minor=14
47.13 + tls_as_opt="-m64 -Aesame --fatal-warnings"
47.14 + ;;
47.15 +- sh-*-* | sh[34]-*-*)
47.16 ++ sh-*-* | sh[34]*-*-*)
47.17 + conftest_s='
47.18 + .section ".tdata","awT",@progbits
47.19 + foo: .long 25
47.20 +diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac
47.21 +--- gcc-4.3.1.orig/gcc/configure.ac 2008-06-10 14:57:48.000000000 +0200
47.22 ++++ gcc-4.3.1/gcc/configure.ac 2008-06-10 14:58:32.000000000 +0200
47.23 +@@ -2537,7 +2537,7 @@
47.24 + tls_first_minor=14
47.25 + tls_as_opt="-m64 -Aesame --fatal-warnings"
47.26 + ;;
47.27 +- sh-*-* | sh[34]-*-*)
47.28 ++ sh-*-* | sh[34]*-*-*)
47.29 + conftest_s='
47.30 + .section ".tdata","awT",@progbits
47.31 + foo: .long 25
48.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
48.2 +++ b/patches/gcc/4.3.1/500-103-uclibc-conf-noupstream.patch Tue Jun 10 22:10:40 2008 +0000
48.3 @@ -0,0 +1,13 @@
48.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_103-uclibc-conf-noupstream.patch
48.5 +diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
48.6 +--- gcc-4.3.1.orig/gcc/config.gcc 2008-06-10 14:58:09.000000000 +0200
48.7 ++++ gcc-4.3.1/gcc/config.gcc 2008-06-10 14:58:36.000000000 +0200
48.8 +@@ -2149,7 +2149,7 @@
48.9 + ;;
48.10 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
48.11 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
48.12 +- sh-*-linux* | sh[346lbe]*-*-linux* | \
48.13 ++ sh*-*-linux* | sh[346lbe]*-*-linux* | \
48.14 + sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
48.15 + sh64-*-netbsd* | sh64l*-*-netbsd*)
48.16 + tmake_file="${tmake_file} sh/t-sh sh/t-elf"
49.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
49.2 +++ b/patches/gcc/4.3.1/525-200-uclibc-locale.patch Tue Jun 10 22:10:40 2008 +0000
49.3 @@ -0,0 +1,2794 @@
49.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_200-uclibc-locale.patch
49.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 gcc-4.3.1/libstdc++-v3/acinclude.m4
49.6 +--- gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 2008-04-25 18:52:57.000000000 +0200
49.7 ++++ gcc-4.3.1/libstdc++-v3/acinclude.m4 2008-06-10 14:58:39.000000000 +0200
49.8 +@@ -1349,7 +1349,7 @@
49.9 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
49.10 + GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
49.11 + [use MODEL for target locale package],
49.12 +- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
49.13 ++ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
49.14 +
49.15 + # Deal with gettext issues. Default to not using it (=no) until we detect
49.16 + # support for it later. Let the user turn it off via --e/d, but let that
49.17 +@@ -1370,6 +1370,9 @@
49.18 + # Default to "generic".
49.19 + if test $enable_clocale_flag = auto; then
49.20 + case ${target_os} in
49.21 ++ *-uclibc*)
49.22 ++ enable_clocale_flag=uclibc
49.23 ++ ;;
49.24 + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
49.25 + enable_clocale_flag=gnu
49.26 + ;;
49.27 +@@ -1541,6 +1544,40 @@
49.28 + CTIME_CC=config/locale/generic/time_members.cc
49.29 + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
49.30 + ;;
49.31 ++ uclibc)
49.32 ++ AC_MSG_RESULT(uclibc)
49.33 ++
49.34 ++ # Declare intention to use gettext, and add support for specific
49.35 ++ # languages.
49.36 ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
49.37 ++ ALL_LINGUAS="de fr"
49.38 ++
49.39 ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
49.40 ++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
49.41 ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
49.42 ++ USE_NLS=yes
49.43 ++ fi
49.44 ++ # Export the build objects.
49.45 ++ for ling in $ALL_LINGUAS; do \
49.46 ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
49.47 ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
49.48 ++ done
49.49 ++ AC_SUBST(glibcxx_MOFILES)
49.50 ++ AC_SUBST(glibcxx_POFILES)
49.51 ++
49.52 ++ CLOCALE_H=config/locale/uclibc/c_locale.h
49.53 ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
49.54 ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
49.55 ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
49.56 ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
49.57 ++ CMESSAGES_H=config/locale/uclibc/messages_members.h
49.58 ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
49.59 ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
49.60 ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
49.61 ++ CTIME_H=config/locale/uclibc/time_members.h
49.62 ++ CTIME_CC=config/locale/uclibc/time_members.cc
49.63 ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
49.64 ++ ;;
49.65 + esac
49.66 +
49.67 + # This is where the testsuite looks for locale catalogs, using the
49.68 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
49.69 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100
49.70 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:39.000000000 +0200
49.71 +@@ -0,0 +1,63 @@
49.72 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
49.73 ++
49.74 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
49.75 ++//
49.76 ++// This file is part of the GNU ISO C++ Library. This library is free
49.77 ++// software; you can redistribute it and/or modify it under the
49.78 ++// terms of the GNU General Public License as published by the
49.79 ++// Free Software Foundation; either version 2, or (at your option)
49.80 ++// any later version.
49.81 ++
49.82 ++// This library is distributed in the hope that it will be useful,
49.83 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.84 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.85 ++// GNU General Public License for more details.
49.86 ++
49.87 ++// You should have received a copy of the GNU General Public License along
49.88 ++// with this library; see the file COPYING. If not, write to the Free
49.89 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.90 ++// USA.
49.91 ++
49.92 ++// As a special exception, you may use this file as part of a free software
49.93 ++// library without restriction. Specifically, if other files instantiate
49.94 ++// templates or use macros or inline functions from this file, or you compile
49.95 ++// this file and link it with other files to produce an executable, this
49.96 ++// file does not by itself cause the resulting executable to be covered by
49.97 ++// the GNU General Public License. This exception does not however
49.98 ++// invalidate any other reasons why the executable file might be covered by
49.99 ++// the GNU General Public License.
49.100 ++
49.101 ++// Written by Jakub Jelinek <jakub@redhat.com>
49.102 ++
49.103 ++#include <bits/c++config.h>
49.104 ++#include <clocale>
49.105 ++
49.106 ++#ifdef __UCLIBC_MJN3_ONLY__
49.107 ++#warning clean this up
49.108 ++#endif
49.109 ++
49.110 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.111 ++
49.112 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
49.113 ++extern "C" __typeof(strcoll_l) __strcoll_l;
49.114 ++extern "C" __typeof(strftime_l) __strftime_l;
49.115 ++extern "C" __typeof(strtod_l) __strtod_l;
49.116 ++extern "C" __typeof(strtof_l) __strtof_l;
49.117 ++extern "C" __typeof(strtold_l) __strtold_l;
49.118 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
49.119 ++extern "C" __typeof(newlocale) __newlocale;
49.120 ++extern "C" __typeof(freelocale) __freelocale;
49.121 ++extern "C" __typeof(duplocale) __duplocale;
49.122 ++extern "C" __typeof(uselocale) __uselocale;
49.123 ++
49.124 ++#ifdef _GLIBCXX_USE_WCHAR_T
49.125 ++extern "C" __typeof(iswctype_l) __iswctype_l;
49.126 ++extern "C" __typeof(towlower_l) __towlower_l;
49.127 ++extern "C" __typeof(towupper_l) __towupper_l;
49.128 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
49.129 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
49.130 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
49.131 ++extern "C" __typeof(wctype_l) __wctype_l;
49.132 ++#endif
49.133 ++
49.134 ++#endif // GLIBC 2.3 and later
49.135 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
49.136 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100
49.137 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:39.000000000 +0200
49.138 +@@ -0,0 +1,160 @@
49.139 ++// Wrapper for underlying C-language localization -*- C++ -*-
49.140 ++
49.141 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
49.142 ++//
49.143 ++// This file is part of the GNU ISO C++ Library. This library is free
49.144 ++// software; you can redistribute it and/or modify it under the
49.145 ++// terms of the GNU General Public License as published by the
49.146 ++// Free Software Foundation; either version 2, or (at your option)
49.147 ++// any later version.
49.148 ++
49.149 ++// This library is distributed in the hope that it will be useful,
49.150 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.151 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.152 ++// GNU General Public License for more details.
49.153 ++
49.154 ++// You should have received a copy of the GNU General Public License along
49.155 ++// with this library; see the file COPYING. If not, write to the Free
49.156 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.157 ++// USA.
49.158 ++
49.159 ++// As a special exception, you may use this file as part of a free software
49.160 ++// library without restriction. Specifically, if other files instantiate
49.161 ++// templates or use macros or inline functions from this file, or you compile
49.162 ++// this file and link it with other files to produce an executable, this
49.163 ++// file does not by itself cause the resulting executable to be covered by
49.164 ++// the GNU General Public License. This exception does not however
49.165 ++// invalidate any other reasons why the executable file might be covered by
49.166 ++// the GNU General Public License.
49.167 ++
49.168 ++//
49.169 ++// ISO C++ 14882: 22.8 Standard locale categories.
49.170 ++//
49.171 ++
49.172 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.173 ++
49.174 ++#include <cerrno> // For errno
49.175 ++#include <locale>
49.176 ++#include <stdexcept>
49.177 ++#include <langinfo.h>
49.178 ++#include <bits/c++locale_internal.h>
49.179 ++
49.180 ++#ifndef __UCLIBC_HAS_XLOCALE__
49.181 ++#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
49.182 ++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
49.183 ++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
49.184 ++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
49.185 ++#define __strtof_l(S, E, L) strtof((S), (E))
49.186 ++#define __strtod_l(S, E, L) strtod((S), (E))
49.187 ++#define __strtold_l(S, E, L) strtold((S), (E))
49.188 ++#warning should dummy __newlocale check for C|POSIX ?
49.189 ++#define __newlocale(a, b, c) NULL
49.190 ++#define __freelocale(a) ((void)0)
49.191 ++#define __duplocale(a) __c_locale()
49.192 ++#endif
49.193 ++
49.194 ++namespace std
49.195 ++{
49.196 ++ template<>
49.197 ++ void
49.198 ++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
49.199 ++ const __c_locale& __cloc)
49.200 ++ {
49.201 ++ if (!(__err & ios_base::failbit))
49.202 ++ {
49.203 ++ char* __sanity;
49.204 ++ errno = 0;
49.205 ++ float __f = __strtof_l(__s, &__sanity, __cloc);
49.206 ++ if (__sanity != __s && errno != ERANGE)
49.207 ++ __v = __f;
49.208 ++ else
49.209 ++ __err |= ios_base::failbit;
49.210 ++ }
49.211 ++ }
49.212 ++
49.213 ++ template<>
49.214 ++ void
49.215 ++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
49.216 ++ const __c_locale& __cloc)
49.217 ++ {
49.218 ++ if (!(__err & ios_base::failbit))
49.219 ++ {
49.220 ++ char* __sanity;
49.221 ++ errno = 0;
49.222 ++ double __d = __strtod_l(__s, &__sanity, __cloc);
49.223 ++ if (__sanity != __s && errno != ERANGE)
49.224 ++ __v = __d;
49.225 ++ else
49.226 ++ __err |= ios_base::failbit;
49.227 ++ }
49.228 ++ }
49.229 ++
49.230 ++ template<>
49.231 ++ void
49.232 ++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
49.233 ++ const __c_locale& __cloc)
49.234 ++ {
49.235 ++ if (!(__err & ios_base::failbit))
49.236 ++ {
49.237 ++ char* __sanity;
49.238 ++ errno = 0;
49.239 ++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
49.240 ++ if (__sanity != __s && errno != ERANGE)
49.241 ++ __v = __ld;
49.242 ++ else
49.243 ++ __err |= ios_base::failbit;
49.244 ++ }
49.245 ++ }
49.246 ++
49.247 ++ void
49.248 ++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
49.249 ++ __c_locale __old)
49.250 ++ {
49.251 ++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
49.252 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.253 ++ if (!__cloc)
49.254 ++ {
49.255 ++ // This named locale is not supported by the underlying OS.
49.256 ++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
49.257 ++ "name not valid"));
49.258 ++ }
49.259 ++#endif
49.260 ++ }
49.261 ++
49.262 ++ void
49.263 ++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
49.264 ++ {
49.265 ++ if (_S_get_c_locale() != __cloc)
49.266 ++ __freelocale(__cloc);
49.267 ++ }
49.268 ++
49.269 ++ __c_locale
49.270 ++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
49.271 ++ { return __duplocale(__cloc); }
49.272 ++} // namespace std
49.273 ++
49.274 ++namespace __gnu_cxx
49.275 ++{
49.276 ++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
49.277 ++ {
49.278 ++ "LC_CTYPE",
49.279 ++ "LC_NUMERIC",
49.280 ++ "LC_TIME",
49.281 ++ "LC_COLLATE",
49.282 ++ "LC_MONETARY",
49.283 ++ "LC_MESSAGES",
49.284 ++#if _GLIBCXX_NUM_CATEGORIES != 0
49.285 ++ "LC_PAPER",
49.286 ++ "LC_NAME",
49.287 ++ "LC_ADDRESS",
49.288 ++ "LC_TELEPHONE",
49.289 ++ "LC_MEASUREMENT",
49.290 ++ "LC_IDENTIFICATION"
49.291 ++#endif
49.292 ++ };
49.293 ++}
49.294 ++
49.295 ++namespace std
49.296 ++{
49.297 ++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
49.298 ++} // namespace std
49.299 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
49.300 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100
49.301 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:39.000000000 +0200
49.302 +@@ -0,0 +1,117 @@
49.303 ++// Wrapper for underlying C-language localization -*- C++ -*-
49.304 ++
49.305 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
49.306 ++//
49.307 ++// This file is part of the GNU ISO C++ Library. This library is free
49.308 ++// software; you can redistribute it and/or modify it under the
49.309 ++// terms of the GNU General Public License as published by the
49.310 ++// Free Software Foundation; either version 2, or (at your option)
49.311 ++// any later version.
49.312 ++
49.313 ++// This library is distributed in the hope that it will be useful,
49.314 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.315 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.316 ++// GNU General Public License for more details.
49.317 ++
49.318 ++// You should have received a copy of the GNU General Public License along
49.319 ++// with this library; see the file COPYING. If not, write to the Free
49.320 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.321 ++// USA.
49.322 ++
49.323 ++// As a special exception, you may use this file as part of a free software
49.324 ++// library without restriction. Specifically, if other files instantiate
49.325 ++// templates or use macros or inline functions from this file, or you compile
49.326 ++// this file and link it with other files to produce an executable, this
49.327 ++// file does not by itself cause the resulting executable to be covered by
49.328 ++// the GNU General Public License. This exception does not however
49.329 ++// invalidate any other reasons why the executable file might be covered by
49.330 ++// the GNU General Public License.
49.331 ++
49.332 ++//
49.333 ++// ISO C++ 14882: 22.8 Standard locale categories.
49.334 ++//
49.335 ++
49.336 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.337 ++
49.338 ++#ifndef _C_LOCALE_H
49.339 ++#define _C_LOCALE_H 1
49.340 ++
49.341 ++#pragma GCC system_header
49.342 ++
49.343 ++#include <cstring> // get std::strlen
49.344 ++#include <cstdio> // get std::snprintf or std::sprintf
49.345 ++#include <clocale>
49.346 ++#include <langinfo.h> // For codecvt
49.347 ++#ifdef __UCLIBC_MJN3_ONLY__
49.348 ++#warning fix this
49.349 ++#endif
49.350 ++#ifdef __UCLIBC_HAS_LOCALE__
49.351 ++#include <iconv.h> // For codecvt using iconv, iconv_t
49.352 ++#endif
49.353 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
49.354 ++#include <libintl.h> // For messages
49.355 ++#endif
49.356 ++
49.357 ++#ifdef __UCLIBC_MJN3_ONLY__
49.358 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
49.359 ++#endif
49.360 ++#define _GLIBCXX_C_LOCALE_GNU 1
49.361 ++
49.362 ++#ifdef __UCLIBC_MJN3_ONLY__
49.363 ++#warning fix categories
49.364 ++#endif
49.365 ++// #define _GLIBCXX_NUM_CATEGORIES 6
49.366 ++#define _GLIBCXX_NUM_CATEGORIES 0
49.367 ++
49.368 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.369 ++namespace __gnu_cxx
49.370 ++{
49.371 ++ extern "C" __typeof(uselocale) __uselocale;
49.372 ++}
49.373 ++#endif
49.374 ++
49.375 ++namespace std
49.376 ++{
49.377 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.378 ++ typedef __locale_t __c_locale;
49.379 ++#else
49.380 ++ typedef int* __c_locale;
49.381 ++#endif
49.382 ++
49.383 ++ // Convert numeric value of type _Tv to string and return length of
49.384 ++ // string. If snprintf is available use it, otherwise fall back to
49.385 ++ // the unsafe sprintf which, in general, can be dangerous and should
49.386 ++ // be avoided.
49.387 ++ template<typename _Tv>
49.388 ++ int
49.389 ++ __convert_from_v(char* __out,
49.390 ++ const int __size __attribute__ ((__unused__)),
49.391 ++ const char* __fmt,
49.392 ++#ifdef __UCLIBC_HAS_XCLOCALE__
49.393 ++ _Tv __v, const __c_locale& __cloc, int __prec)
49.394 ++ {
49.395 ++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
49.396 ++#else
49.397 ++ _Tv __v, const __c_locale&, int __prec)
49.398 ++ {
49.399 ++# ifdef __UCLIBC_HAS_LOCALE__
49.400 ++ char* __old = std::setlocale(LC_ALL, NULL);
49.401 ++ char* __sav = new char[std::strlen(__old) + 1];
49.402 ++ std::strcpy(__sav, __old);
49.403 ++ std::setlocale(LC_ALL, "C");
49.404 ++# endif
49.405 ++#endif
49.406 ++
49.407 ++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
49.408 ++
49.409 ++#ifdef __UCLIBC_HAS_XCLOCALE__
49.410 ++ __gnu_cxx::__uselocale(__old);
49.411 ++#elif defined __UCLIBC_HAS_LOCALE__
49.412 ++ std::setlocale(LC_ALL, __sav);
49.413 ++ delete [] __sav;
49.414 ++#endif
49.415 ++ return __ret;
49.416 ++ }
49.417 ++}
49.418 ++
49.419 ++#endif
49.420 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
49.421 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100
49.422 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-06-10 14:58:39.000000000 +0200
49.423 +@@ -0,0 +1,306 @@
49.424 ++// std::codecvt implementation details, GNU version -*- C++ -*-
49.425 ++
49.426 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
49.427 ++//
49.428 ++// This file is part of the GNU ISO C++ Library. This library is free
49.429 ++// software; you can redistribute it and/or modify it under the
49.430 ++// terms of the GNU General Public License as published by the
49.431 ++// Free Software Foundation; either version 2, or (at your option)
49.432 ++// any later version.
49.433 ++
49.434 ++// This library is distributed in the hope that it will be useful,
49.435 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.436 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.437 ++// GNU General Public License for more details.
49.438 ++
49.439 ++// You should have received a copy of the GNU General Public License along
49.440 ++// with this library; see the file COPYING. If not, write to the Free
49.441 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.442 ++// USA.
49.443 ++
49.444 ++// As a special exception, you may use this file as part of a free software
49.445 ++// library without restriction. Specifically, if other files instantiate
49.446 ++// templates or use macros or inline functions from this file, or you compile
49.447 ++// this file and link it with other files to produce an executable, this
49.448 ++// file does not by itself cause the resulting executable to be covered by
49.449 ++// the GNU General Public License. This exception does not however
49.450 ++// invalidate any other reasons why the executable file might be covered by
49.451 ++// the GNU General Public License.
49.452 ++
49.453 ++//
49.454 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
49.455 ++//
49.456 ++
49.457 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.458 ++
49.459 ++#include <locale>
49.460 ++#include <bits/c++locale_internal.h>
49.461 ++
49.462 ++namespace std
49.463 ++{
49.464 ++ // Specializations.
49.465 ++#ifdef _GLIBCXX_USE_WCHAR_T
49.466 ++ codecvt_base::result
49.467 ++ codecvt<wchar_t, char, mbstate_t>::
49.468 ++ do_out(state_type& __state, const intern_type* __from,
49.469 ++ const intern_type* __from_end, const intern_type*& __from_next,
49.470 ++ extern_type* __to, extern_type* __to_end,
49.471 ++ extern_type*& __to_next) const
49.472 ++ {
49.473 ++ result __ret = ok;
49.474 ++ state_type __tmp_state(__state);
49.475 ++
49.476 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.477 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
49.478 ++#endif
49.479 ++
49.480 ++ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
49.481 ++ // in case we fall back to wcrtomb and then continue, in a loop.
49.482 ++ // NB: wcsnrtombs is a GNU extension
49.483 ++ for (__from_next = __from, __to_next = __to;
49.484 ++ __from_next < __from_end && __to_next < __to_end
49.485 ++ && __ret == ok;)
49.486 ++ {
49.487 ++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
49.488 ++ __from_end - __from_next);
49.489 ++ if (!__from_chunk_end)
49.490 ++ __from_chunk_end = __from_end;
49.491 ++
49.492 ++ __from = __from_next;
49.493 ++ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
49.494 ++ __from_chunk_end - __from_next,
49.495 ++ __to_end - __to_next, &__state);
49.496 ++ if (__conv == static_cast<size_t>(-1))
49.497 ++ {
49.498 ++ // In case of error, in order to stop at the exact place we
49.499 ++ // have to start again from the beginning with a series of
49.500 ++ // wcrtomb.
49.501 ++ for (; __from < __from_next; ++__from)
49.502 ++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
49.503 ++ __state = __tmp_state;
49.504 ++ __ret = error;
49.505 ++ }
49.506 ++ else if (__from_next && __from_next < __from_chunk_end)
49.507 ++ {
49.508 ++ __to_next += __conv;
49.509 ++ __ret = partial;
49.510 ++ }
49.511 ++ else
49.512 ++ {
49.513 ++ __from_next = __from_chunk_end;
49.514 ++ __to_next += __conv;
49.515 ++ }
49.516 ++
49.517 ++ if (__from_next < __from_end && __ret == ok)
49.518 ++ {
49.519 ++ extern_type __buf[MB_LEN_MAX];
49.520 ++ __tmp_state = __state;
49.521 ++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
49.522 ++ if (__conv > static_cast<size_t>(__to_end - __to_next))
49.523 ++ __ret = partial;
49.524 ++ else
49.525 ++ {
49.526 ++ memcpy(__to_next, __buf, __conv);
49.527 ++ __state = __tmp_state;
49.528 ++ __to_next += __conv;
49.529 ++ ++__from_next;
49.530 ++ }
49.531 ++ }
49.532 ++ }
49.533 ++
49.534 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.535 ++ __uselocale(__old);
49.536 ++#endif
49.537 ++
49.538 ++ return __ret;
49.539 ++ }
49.540 ++
49.541 ++ codecvt_base::result
49.542 ++ codecvt<wchar_t, char, mbstate_t>::
49.543 ++ do_in(state_type& __state, const extern_type* __from,
49.544 ++ const extern_type* __from_end, const extern_type*& __from_next,
49.545 ++ intern_type* __to, intern_type* __to_end,
49.546 ++ intern_type*& __to_next) const
49.547 ++ {
49.548 ++ result __ret = ok;
49.549 ++ state_type __tmp_state(__state);
49.550 ++
49.551 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.552 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
49.553 ++#endif
49.554 ++
49.555 ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
49.556 ++ // in case we store a L'\0' and then continue, in a loop.
49.557 ++ // NB: mbsnrtowcs is a GNU extension
49.558 ++ for (__from_next = __from, __to_next = __to;
49.559 ++ __from_next < __from_end && __to_next < __to_end
49.560 ++ && __ret == ok;)
49.561 ++ {
49.562 ++ const extern_type* __from_chunk_end;
49.563 ++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
49.564 ++ __from_end
49.565 ++ - __from_next));
49.566 ++ if (!__from_chunk_end)
49.567 ++ __from_chunk_end = __from_end;
49.568 ++
49.569 ++ __from = __from_next;
49.570 ++ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
49.571 ++ __from_chunk_end - __from_next,
49.572 ++ __to_end - __to_next, &__state);
49.573 ++ if (__conv == static_cast<size_t>(-1))
49.574 ++ {
49.575 ++ // In case of error, in order to stop at the exact place we
49.576 ++ // have to start again from the beginning with a series of
49.577 ++ // mbrtowc.
49.578 ++ for (;; ++__to_next, __from += __conv)
49.579 ++ {
49.580 ++ __conv = mbrtowc(__to_next, __from, __from_end - __from,
49.581 ++ &__tmp_state);
49.582 ++ if (__conv == static_cast<size_t>(-1)
49.583 ++ || __conv == static_cast<size_t>(-2))
49.584 ++ break;
49.585 ++ }
49.586 ++ __from_next = __from;
49.587 ++ __state = __tmp_state;
49.588 ++ __ret = error;
49.589 ++ }
49.590 ++ else if (__from_next && __from_next < __from_chunk_end)
49.591 ++ {
49.592 ++ // It is unclear what to return in this case (see DR 382).
49.593 ++ __to_next += __conv;
49.594 ++ __ret = partial;
49.595 ++ }
49.596 ++ else
49.597 ++ {
49.598 ++ __from_next = __from_chunk_end;
49.599 ++ __to_next += __conv;
49.600 ++ }
49.601 ++
49.602 ++ if (__from_next < __from_end && __ret == ok)
49.603 ++ {
49.604 ++ if (__to_next < __to_end)
49.605 ++ {
49.606 ++ // XXX Probably wrong for stateful encodings
49.607 ++ __tmp_state = __state;
49.608 ++ ++__from_next;
49.609 ++ *__to_next++ = L'\0';
49.610 ++ }
49.611 ++ else
49.612 ++ __ret = partial;
49.613 ++ }
49.614 ++ }
49.615 ++
49.616 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.617 ++ __uselocale(__old);
49.618 ++#endif
49.619 ++
49.620 ++ return __ret;
49.621 ++ }
49.622 ++
49.623 ++ int
49.624 ++ codecvt<wchar_t, char, mbstate_t>::
49.625 ++ do_encoding() const throw()
49.626 ++ {
49.627 ++ // XXX This implementation assumes that the encoding is
49.628 ++ // stateless and is either single-byte or variable-width.
49.629 ++ int __ret = 0;
49.630 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.631 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
49.632 ++#endif
49.633 ++ if (MB_CUR_MAX == 1)
49.634 ++ __ret = 1;
49.635 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.636 ++ __uselocale(__old);
49.637 ++#endif
49.638 ++ return __ret;
49.639 ++ }
49.640 ++
49.641 ++ int
49.642 ++ codecvt<wchar_t, char, mbstate_t>::
49.643 ++ do_max_length() const throw()
49.644 ++ {
49.645 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.646 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
49.647 ++#endif
49.648 ++ // XXX Probably wrong for stateful encodings.
49.649 ++ int __ret = MB_CUR_MAX;
49.650 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.651 ++ __uselocale(__old);
49.652 ++#endif
49.653 ++ return __ret;
49.654 ++ }
49.655 ++
49.656 ++ int
49.657 ++ codecvt<wchar_t, char, mbstate_t>::
49.658 ++ do_length(state_type& __state, const extern_type* __from,
49.659 ++ const extern_type* __end, size_t __max) const
49.660 ++ {
49.661 ++ int __ret = 0;
49.662 ++ state_type __tmp_state(__state);
49.663 ++
49.664 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.665 ++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
49.666 ++#endif
49.667 ++
49.668 ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
49.669 ++ // in case we advance past it and then continue, in a loop.
49.670 ++ // NB: mbsnrtowcs is a GNU extension
49.671 ++
49.672 ++ // A dummy internal buffer is needed in order for mbsnrtocws to consider
49.673 ++ // its fourth parameter (it wouldn't with NULL as first parameter).
49.674 ++ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
49.675 ++ * __max));
49.676 ++ while (__from < __end && __max)
49.677 ++ {
49.678 ++ const extern_type* __from_chunk_end;
49.679 ++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
49.680 ++ __end
49.681 ++ - __from));
49.682 ++ if (!__from_chunk_end)
49.683 ++ __from_chunk_end = __end;
49.684 ++
49.685 ++ const extern_type* __tmp_from = __from;
49.686 ++ size_t __conv = mbsnrtowcs(__to, &__from,
49.687 ++ __from_chunk_end - __from,
49.688 ++ __max, &__state);
49.689 ++ if (__conv == static_cast<size_t>(-1))
49.690 ++ {
49.691 ++ // In case of error, in order to stop at the exact place we
49.692 ++ // have to start again from the beginning with a series of
49.693 ++ // mbrtowc.
49.694 ++ for (__from = __tmp_from;; __from += __conv)
49.695 ++ {
49.696 ++ __conv = mbrtowc(NULL, __from, __end - __from,
49.697 ++ &__tmp_state);
49.698 ++ if (__conv == static_cast<size_t>(-1)
49.699 ++ || __conv == static_cast<size_t>(-2))
49.700 ++ break;
49.701 ++ }
49.702 ++ __state = __tmp_state;
49.703 ++ __ret += __from - __tmp_from;
49.704 ++ break;
49.705 ++ }
49.706 ++ if (!__from)
49.707 ++ __from = __from_chunk_end;
49.708 ++
49.709 ++ __ret += __from - __tmp_from;
49.710 ++ __max -= __conv;
49.711 ++
49.712 ++ if (__from < __end && __max)
49.713 ++ {
49.714 ++ // XXX Probably wrong for stateful encodings
49.715 ++ __tmp_state = __state;
49.716 ++ ++__from;
49.717 ++ ++__ret;
49.718 ++ --__max;
49.719 ++ }
49.720 ++ }
49.721 ++
49.722 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.723 ++ __uselocale(__old);
49.724 ++#endif
49.725 ++
49.726 ++ return __ret;
49.727 ++ }
49.728 ++#endif
49.729 ++}
49.730 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
49.731 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100
49.732 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:39.000000000 +0200
49.733 +@@ -0,0 +1,80 @@
49.734 ++// std::collate implementation details, GNU version -*- C++ -*-
49.735 ++
49.736 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
49.737 ++//
49.738 ++// This file is part of the GNU ISO C++ Library. This library is free
49.739 ++// software; you can redistribute it and/or modify it under the
49.740 ++// terms of the GNU General Public License as published by the
49.741 ++// Free Software Foundation; either version 2, or (at your option)
49.742 ++// any later version.
49.743 ++
49.744 ++// This library is distributed in the hope that it will be useful,
49.745 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.746 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.747 ++// GNU General Public License for more details.
49.748 ++
49.749 ++// You should have received a copy of the GNU General Public License along
49.750 ++// with this library; see the file COPYING. If not, write to the Free
49.751 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.752 ++// USA.
49.753 ++
49.754 ++// As a special exception, you may use this file as part of a free software
49.755 ++// library without restriction. Specifically, if other files instantiate
49.756 ++// templates or use macros or inline functions from this file, or you compile
49.757 ++// this file and link it with other files to produce an executable, this
49.758 ++// file does not by itself cause the resulting executable to be covered by
49.759 ++// the GNU General Public License. This exception does not however
49.760 ++// invalidate any other reasons why the executable file might be covered by
49.761 ++// the GNU General Public License.
49.762 ++
49.763 ++//
49.764 ++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
49.765 ++//
49.766 ++
49.767 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.768 ++
49.769 ++#include <locale>
49.770 ++#include <bits/c++locale_internal.h>
49.771 ++
49.772 ++#ifndef __UCLIBC_HAS_XLOCALE__
49.773 ++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
49.774 ++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
49.775 ++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
49.776 ++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
49.777 ++#endif
49.778 ++
49.779 ++namespace std
49.780 ++{
49.781 ++ // These are basically extensions to char_traits, and perhaps should
49.782 ++ // be put there instead of here.
49.783 ++ template<>
49.784 ++ int
49.785 ++ collate<char>::_M_compare(const char* __one, const char* __two) const
49.786 ++ {
49.787 ++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
49.788 ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
49.789 ++ }
49.790 ++
49.791 ++ template<>
49.792 ++ size_t
49.793 ++ collate<char>::_M_transform(char* __to, const char* __from,
49.794 ++ size_t __n) const
49.795 ++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
49.796 ++
49.797 ++#ifdef _GLIBCXX_USE_WCHAR_T
49.798 ++ template<>
49.799 ++ int
49.800 ++ collate<wchar_t>::_M_compare(const wchar_t* __one,
49.801 ++ const wchar_t* __two) const
49.802 ++ {
49.803 ++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
49.804 ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
49.805 ++ }
49.806 ++
49.807 ++ template<>
49.808 ++ size_t
49.809 ++ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
49.810 ++ size_t __n) const
49.811 ++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
49.812 ++#endif
49.813 ++}
49.814 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
49.815 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100
49.816 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:39.000000000 +0200
49.817 +@@ -0,0 +1,300 @@
49.818 ++// std::ctype implementation details, GNU version -*- C++ -*-
49.819 ++
49.820 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
49.821 ++//
49.822 ++// This file is part of the GNU ISO C++ Library. This library is free
49.823 ++// software; you can redistribute it and/or modify it under the
49.824 ++// terms of the GNU General Public License as published by the
49.825 ++// Free Software Foundation; either version 2, or (at your option)
49.826 ++// any later version.
49.827 ++
49.828 ++// This library is distributed in the hope that it will be useful,
49.829 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.830 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.831 ++// GNU General Public License for more details.
49.832 ++
49.833 ++// You should have received a copy of the GNU General Public License along
49.834 ++// with this library; see the file COPYING. If not, write to the Free
49.835 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.836 ++// USA.
49.837 ++
49.838 ++// As a special exception, you may use this file as part of a free software
49.839 ++// library without restriction. Specifically, if other files instantiate
49.840 ++// templates or use macros or inline functions from this file, or you compile
49.841 ++// this file and link it with other files to produce an executable, this
49.842 ++// file does not by itself cause the resulting executable to be covered by
49.843 ++// the GNU General Public License. This exception does not however
49.844 ++// invalidate any other reasons why the executable file might be covered by
49.845 ++// the GNU General Public License.
49.846 ++
49.847 ++//
49.848 ++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
49.849 ++//
49.850 ++
49.851 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.852 ++
49.853 ++#define _LIBC
49.854 ++#include <locale>
49.855 ++#undef _LIBC
49.856 ++#include <bits/c++locale_internal.h>
49.857 ++
49.858 ++#ifndef __UCLIBC_HAS_XLOCALE__
49.859 ++#define __wctype_l(S, L) wctype((S))
49.860 ++#define __towupper_l(C, L) towupper((C))
49.861 ++#define __towlower_l(C, L) towlower((C))
49.862 ++#define __iswctype_l(C, M, L) iswctype((C), (M))
49.863 ++#endif
49.864 ++
49.865 ++namespace std
49.866 ++{
49.867 ++ // NB: The other ctype<char> specializations are in src/locale.cc and
49.868 ++ // various /config/os/* files.
49.869 ++ template<>
49.870 ++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
49.871 ++ : ctype<char>(0, false, __refs)
49.872 ++ {
49.873 ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
49.874 ++ {
49.875 ++ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
49.876 ++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
49.877 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.878 ++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
49.879 ++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
49.880 ++ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
49.881 ++#endif
49.882 ++ }
49.883 ++ }
49.884 ++
49.885 ++#ifdef _GLIBCXX_USE_WCHAR_T
49.886 ++ ctype<wchar_t>::__wmask_type
49.887 ++ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
49.888 ++ {
49.889 ++ __wmask_type __ret;
49.890 ++ switch (__m)
49.891 ++ {
49.892 ++ case space:
49.893 ++ __ret = __wctype_l("space", _M_c_locale_ctype);
49.894 ++ break;
49.895 ++ case print:
49.896 ++ __ret = __wctype_l("print", _M_c_locale_ctype);
49.897 ++ break;
49.898 ++ case cntrl:
49.899 ++ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
49.900 ++ break;
49.901 ++ case upper:
49.902 ++ __ret = __wctype_l("upper", _M_c_locale_ctype);
49.903 ++ break;
49.904 ++ case lower:
49.905 ++ __ret = __wctype_l("lower", _M_c_locale_ctype);
49.906 ++ break;
49.907 ++ case alpha:
49.908 ++ __ret = __wctype_l("alpha", _M_c_locale_ctype);
49.909 ++ break;
49.910 ++ case digit:
49.911 ++ __ret = __wctype_l("digit", _M_c_locale_ctype);
49.912 ++ break;
49.913 ++ case punct:
49.914 ++ __ret = __wctype_l("punct", _M_c_locale_ctype);
49.915 ++ break;
49.916 ++ case xdigit:
49.917 ++ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
49.918 ++ break;
49.919 ++ case alnum:
49.920 ++ __ret = __wctype_l("alnum", _M_c_locale_ctype);
49.921 ++ break;
49.922 ++ case graph:
49.923 ++ __ret = __wctype_l("graph", _M_c_locale_ctype);
49.924 ++ break;
49.925 ++ default:
49.926 ++ __ret = __wmask_type();
49.927 ++ }
49.928 ++ return __ret;
49.929 ++ }
49.930 ++
49.931 ++ wchar_t
49.932 ++ ctype<wchar_t>::do_toupper(wchar_t __c) const
49.933 ++ { return __towupper_l(__c, _M_c_locale_ctype); }
49.934 ++
49.935 ++ const wchar_t*
49.936 ++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
49.937 ++ {
49.938 ++ while (__lo < __hi)
49.939 ++ {
49.940 ++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
49.941 ++ ++__lo;
49.942 ++ }
49.943 ++ return __hi;
49.944 ++ }
49.945 ++
49.946 ++ wchar_t
49.947 ++ ctype<wchar_t>::do_tolower(wchar_t __c) const
49.948 ++ { return __towlower_l(__c, _M_c_locale_ctype); }
49.949 ++
49.950 ++ const wchar_t*
49.951 ++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
49.952 ++ {
49.953 ++ while (__lo < __hi)
49.954 ++ {
49.955 ++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
49.956 ++ ++__lo;
49.957 ++ }
49.958 ++ return __hi;
49.959 ++ }
49.960 ++
49.961 ++ bool
49.962 ++ ctype<wchar_t>::
49.963 ++ do_is(mask __m, wchar_t __c) const
49.964 ++ {
49.965 ++ // Highest bitmask in ctype_base == 10, but extra in "C"
49.966 ++ // library for blank.
49.967 ++ bool __ret = false;
49.968 ++ const size_t __bitmasksize = 11;
49.969 ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
49.970 ++ if (__m & _M_bit[__bitcur]
49.971 ++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
49.972 ++ {
49.973 ++ __ret = true;
49.974 ++ break;
49.975 ++ }
49.976 ++ return __ret;
49.977 ++ }
49.978 ++
49.979 ++ const wchar_t*
49.980 ++ ctype<wchar_t>::
49.981 ++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
49.982 ++ {
49.983 ++ for (; __lo < __hi; ++__vec, ++__lo)
49.984 ++ {
49.985 ++ // Highest bitmask in ctype_base == 10, but extra in "C"
49.986 ++ // library for blank.
49.987 ++ const size_t __bitmasksize = 11;
49.988 ++ mask __m = 0;
49.989 ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
49.990 ++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
49.991 ++ __m |= _M_bit[__bitcur];
49.992 ++ *__vec = __m;
49.993 ++ }
49.994 ++ return __hi;
49.995 ++ }
49.996 ++
49.997 ++ const wchar_t*
49.998 ++ ctype<wchar_t>::
49.999 ++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
49.1000 ++ {
49.1001 ++ while (__lo < __hi && !this->do_is(__m, *__lo))
49.1002 ++ ++__lo;
49.1003 ++ return __lo;
49.1004 ++ }
49.1005 ++
49.1006 ++ const wchar_t*
49.1007 ++ ctype<wchar_t>::
49.1008 ++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
49.1009 ++ {
49.1010 ++ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
49.1011 ++ ++__lo;
49.1012 ++ return __lo;
49.1013 ++ }
49.1014 ++
49.1015 ++ wchar_t
49.1016 ++ ctype<wchar_t>::
49.1017 ++ do_widen(char __c) const
49.1018 ++ { return _M_widen[static_cast<unsigned char>(__c)]; }
49.1019 ++
49.1020 ++ const char*
49.1021 ++ ctype<wchar_t>::
49.1022 ++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
49.1023 ++ {
49.1024 ++ while (__lo < __hi)
49.1025 ++ {
49.1026 ++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
49.1027 ++ ++__lo;
49.1028 ++ ++__dest;
49.1029 ++ }
49.1030 ++ return __hi;
49.1031 ++ }
49.1032 ++
49.1033 ++ char
49.1034 ++ ctype<wchar_t>::
49.1035 ++ do_narrow(wchar_t __wc, char __dfault) const
49.1036 ++ {
49.1037 ++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
49.1038 ++ return _M_narrow[__wc];
49.1039 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1040 ++ __c_locale __old = __uselocale(_M_c_locale_ctype);
49.1041 ++#endif
49.1042 ++ const int __c = wctob(__wc);
49.1043 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1044 ++ __uselocale(__old);
49.1045 ++#endif
49.1046 ++ return (__c == EOF ? __dfault : static_cast<char>(__c));
49.1047 ++ }
49.1048 ++
49.1049 ++ const wchar_t*
49.1050 ++ ctype<wchar_t>::
49.1051 ++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
49.1052 ++ char* __dest) const
49.1053 ++ {
49.1054 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1055 ++ __c_locale __old = __uselocale(_M_c_locale_ctype);
49.1056 ++#endif
49.1057 ++ if (_M_narrow_ok)
49.1058 ++ while (__lo < __hi)
49.1059 ++ {
49.1060 ++ if (*__lo >= 0 && *__lo < 128)
49.1061 ++ *__dest = _M_narrow[*__lo];
49.1062 ++ else
49.1063 ++ {
49.1064 ++ const int __c = wctob(*__lo);
49.1065 ++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
49.1066 ++ }
49.1067 ++ ++__lo;
49.1068 ++ ++__dest;
49.1069 ++ }
49.1070 ++ else
49.1071 ++ while (__lo < __hi)
49.1072 ++ {
49.1073 ++ const int __c = wctob(*__lo);
49.1074 ++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
49.1075 ++ ++__lo;
49.1076 ++ ++__dest;
49.1077 ++ }
49.1078 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1079 ++ __uselocale(__old);
49.1080 ++#endif
49.1081 ++ return __hi;
49.1082 ++ }
49.1083 ++
49.1084 ++ void
49.1085 ++ ctype<wchar_t>::_M_initialize_ctype()
49.1086 ++ {
49.1087 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1088 ++ __c_locale __old = __uselocale(_M_c_locale_ctype);
49.1089 ++#endif
49.1090 ++ wint_t __i;
49.1091 ++ for (__i = 0; __i < 128; ++__i)
49.1092 ++ {
49.1093 ++ const int __c = wctob(__i);
49.1094 ++ if (__c == EOF)
49.1095 ++ break;
49.1096 ++ else
49.1097 ++ _M_narrow[__i] = static_cast<char>(__c);
49.1098 ++ }
49.1099 ++ if (__i == 128)
49.1100 ++ _M_narrow_ok = true;
49.1101 ++ else
49.1102 ++ _M_narrow_ok = false;
49.1103 ++ for (size_t __j = 0;
49.1104 ++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
49.1105 ++ _M_widen[__j] = btowc(__j);
49.1106 ++
49.1107 ++ for (size_t __k = 0; __k <= 11; ++__k)
49.1108 ++ {
49.1109 ++ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
49.1110 ++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
49.1111 ++ }
49.1112 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1113 ++ __uselocale(__old);
49.1114 ++#endif
49.1115 ++ }
49.1116 ++#endif // _GLIBCXX_USE_WCHAR_T
49.1117 ++}
49.1118 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
49.1119 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100
49.1120 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:39.000000000 +0200
49.1121 +@@ -0,0 +1,100 @@
49.1122 ++// std::messages implementation details, GNU version -*- C++ -*-
49.1123 ++
49.1124 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
49.1125 ++//
49.1126 ++// This file is part of the GNU ISO C++ Library. This library is free
49.1127 ++// software; you can redistribute it and/or modify it under the
49.1128 ++// terms of the GNU General Public License as published by the
49.1129 ++// Free Software Foundation; either version 2, or (at your option)
49.1130 ++// any later version.
49.1131 ++
49.1132 ++// This library is distributed in the hope that it will be useful,
49.1133 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.1134 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.1135 ++// GNU General Public License for more details.
49.1136 ++
49.1137 ++// You should have received a copy of the GNU General Public License along
49.1138 ++// with this library; see the file COPYING. If not, write to the Free
49.1139 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.1140 ++// USA.
49.1141 ++
49.1142 ++// As a special exception, you may use this file as part of a free software
49.1143 ++// library without restriction. Specifically, if other files instantiate
49.1144 ++// templates or use macros or inline functions from this file, or you compile
49.1145 ++// this file and link it with other files to produce an executable, this
49.1146 ++// file does not by itself cause the resulting executable to be covered by
49.1147 ++// the GNU General Public License. This exception does not however
49.1148 ++// invalidate any other reasons why the executable file might be covered by
49.1149 ++// the GNU General Public License.
49.1150 ++
49.1151 ++//
49.1152 ++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
49.1153 ++//
49.1154 ++
49.1155 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.1156 ++
49.1157 ++#include <locale>
49.1158 ++#include <bits/c++locale_internal.h>
49.1159 ++
49.1160 ++#ifdef __UCLIBC_MJN3_ONLY__
49.1161 ++#warning fix gettext stuff
49.1162 ++#endif
49.1163 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
49.1164 ++extern "C" char *__dcgettext(const char *domainname,
49.1165 ++ const char *msgid, int category);
49.1166 ++#undef gettext
49.1167 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
49.1168 ++#else
49.1169 ++#undef gettext
49.1170 ++#define gettext(msgid) (msgid)
49.1171 ++#endif
49.1172 ++
49.1173 ++namespace std
49.1174 ++{
49.1175 ++ // Specializations.
49.1176 ++ template<>
49.1177 ++ string
49.1178 ++ messages<char>::do_get(catalog, int, int, const string& __dfault) const
49.1179 ++ {
49.1180 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1181 ++ __c_locale __old = __uselocale(_M_c_locale_messages);
49.1182 ++ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
49.1183 ++ __uselocale(__old);
49.1184 ++ return string(__msg);
49.1185 ++#elif defined __UCLIBC_HAS_LOCALE__
49.1186 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
49.1187 ++ setlocale(LC_ALL, _M_name_messages);
49.1188 ++ const char* __msg = gettext(__dfault.c_str());
49.1189 ++ setlocale(LC_ALL, __old);
49.1190 ++ free(__old);
49.1191 ++ return string(__msg);
49.1192 ++#else
49.1193 ++ const char* __msg = gettext(__dfault.c_str());
49.1194 ++ return string(__msg);
49.1195 ++#endif
49.1196 ++ }
49.1197 ++
49.1198 ++#ifdef _GLIBCXX_USE_WCHAR_T
49.1199 ++ template<>
49.1200 ++ wstring
49.1201 ++ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
49.1202 ++ {
49.1203 ++# ifdef __UCLIBC_HAS_XLOCALE__
49.1204 ++ __c_locale __old = __uselocale(_M_c_locale_messages);
49.1205 ++ char* __msg = gettext(_M_convert_to_char(__dfault));
49.1206 ++ __uselocale(__old);
49.1207 ++ return _M_convert_from_char(__msg);
49.1208 ++# elif defined __UCLIBC_HAS_LOCALE__
49.1209 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
49.1210 ++ setlocale(LC_ALL, _M_name_messages);
49.1211 ++ char* __msg = gettext(_M_convert_to_char(__dfault));
49.1212 ++ setlocale(LC_ALL, __old);
49.1213 ++ free(__old);
49.1214 ++ return _M_convert_from_char(__msg);
49.1215 ++# else
49.1216 ++ char* __msg = gettext(_M_convert_to_char(__dfault));
49.1217 ++ return _M_convert_from_char(__msg);
49.1218 ++# endif
49.1219 ++ }
49.1220 ++#endif
49.1221 ++}
49.1222 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
49.1223 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100
49.1224 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:39.000000000 +0200
49.1225 +@@ -0,0 +1,118 @@
49.1226 ++// std::messages implementation details, GNU version -*- C++ -*-
49.1227 ++
49.1228 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
49.1229 ++//
49.1230 ++// This file is part of the GNU ISO C++ Library. This library is free
49.1231 ++// software; you can redistribute it and/or modify it under the
49.1232 ++// terms of the GNU General Public License as published by the
49.1233 ++// Free Software Foundation; either version 2, or (at your option)
49.1234 ++// any later version.
49.1235 ++
49.1236 ++// This library is distributed in the hope that it will be useful,
49.1237 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.1238 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.1239 ++// GNU General Public License for more details.
49.1240 ++
49.1241 ++// You should have received a copy of the GNU General Public License along
49.1242 ++// with this library; see the file COPYING. If not, write to the Free
49.1243 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.1244 ++// USA.
49.1245 ++
49.1246 ++// As a special exception, you may use this file as part of a free software
49.1247 ++// library without restriction. Specifically, if other files instantiate
49.1248 ++// templates or use macros or inline functions from this file, or you compile
49.1249 ++// this file and link it with other files to produce an executable, this
49.1250 ++// file does not by itself cause the resulting executable to be covered by
49.1251 ++// the GNU General Public License. This exception does not however
49.1252 ++// invalidate any other reasons why the executable file might be covered by
49.1253 ++// the GNU General Public License.
49.1254 ++
49.1255 ++//
49.1256 ++// ISO C++ 14882: 22.2.7.1.2 messages functions
49.1257 ++//
49.1258 ++
49.1259 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.1260 ++
49.1261 ++#ifdef __UCLIBC_MJN3_ONLY__
49.1262 ++#warning fix prototypes for *textdomain funcs
49.1263 ++#endif
49.1264 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
49.1265 ++extern "C" char *__textdomain(const char *domainname);
49.1266 ++extern "C" char *__bindtextdomain(const char *domainname,
49.1267 ++ const char *dirname);
49.1268 ++#else
49.1269 ++#undef __textdomain
49.1270 ++#undef __bindtextdomain
49.1271 ++#define __textdomain(D) ((void)0)
49.1272 ++#define __bindtextdomain(D,P) ((void)0)
49.1273 ++#endif
49.1274 ++
49.1275 ++ // Non-virtual member functions.
49.1276 ++ template<typename _CharT>
49.1277 ++ messages<_CharT>::messages(size_t __refs)
49.1278 ++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
49.1279 ++ _M_name_messages(_S_get_c_name())
49.1280 ++ { }
49.1281 ++
49.1282 ++ template<typename _CharT>
49.1283 ++ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
49.1284 ++ size_t __refs)
49.1285 ++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
49.1286 ++ _M_name_messages(__s)
49.1287 ++ {
49.1288 ++ char* __tmp = new char[std::strlen(__s) + 1];
49.1289 ++ std::strcpy(__tmp, __s);
49.1290 ++ _M_name_messages = __tmp;
49.1291 ++ }
49.1292 ++
49.1293 ++ template<typename _CharT>
49.1294 ++ typename messages<_CharT>::catalog
49.1295 ++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
49.1296 ++ const char* __dir) const
49.1297 ++ {
49.1298 ++ __bindtextdomain(__s.c_str(), __dir);
49.1299 ++ return this->do_open(__s, __loc);
49.1300 ++ }
49.1301 ++
49.1302 ++ // Virtual member functions.
49.1303 ++ template<typename _CharT>
49.1304 ++ messages<_CharT>::~messages()
49.1305 ++ {
49.1306 ++ if (_M_name_messages != _S_get_c_name())
49.1307 ++ delete [] _M_name_messages;
49.1308 ++ _S_destroy_c_locale(_M_c_locale_messages);
49.1309 ++ }
49.1310 ++
49.1311 ++ template<typename _CharT>
49.1312 ++ typename messages<_CharT>::catalog
49.1313 ++ messages<_CharT>::do_open(const basic_string<char>& __s,
49.1314 ++ const locale&) const
49.1315 ++ {
49.1316 ++ // No error checking is done, assume the catalog exists and can
49.1317 ++ // be used.
49.1318 ++ __textdomain(__s.c_str());
49.1319 ++ return 0;
49.1320 ++ }
49.1321 ++
49.1322 ++ template<typename _CharT>
49.1323 ++ void
49.1324 ++ messages<_CharT>::do_close(catalog) const
49.1325 ++ { }
49.1326 ++
49.1327 ++ // messages_byname
49.1328 ++ template<typename _CharT>
49.1329 ++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
49.1330 ++ : messages<_CharT>(__refs)
49.1331 ++ {
49.1332 ++ if (this->_M_name_messages != locale::facet::_S_get_c_name())
49.1333 ++ delete [] this->_M_name_messages;
49.1334 ++ char* __tmp = new char[std::strlen(__s) + 1];
49.1335 ++ std::strcpy(__tmp, __s);
49.1336 ++ this->_M_name_messages = __tmp;
49.1337 ++
49.1338 ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
49.1339 ++ {
49.1340 ++ this->_S_destroy_c_locale(this->_M_c_locale_messages);
49.1341 ++ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
49.1342 ++ }
49.1343 ++ }
49.1344 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
49.1345 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100
49.1346 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:39.000000000 +0200
49.1347 +@@ -0,0 +1,692 @@
49.1348 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
49.1349 ++
49.1350 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
49.1351 ++//
49.1352 ++// This file is part of the GNU ISO C++ Library. This library is free
49.1353 ++// software; you can redistribute it and/or modify it under the
49.1354 ++// terms of the GNU General Public License as published by the
49.1355 ++// Free Software Foundation; either version 2, or (at your option)
49.1356 ++// any later version.
49.1357 ++
49.1358 ++// This library is distributed in the hope that it will be useful,
49.1359 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.1360 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.1361 ++// GNU General Public License for more details.
49.1362 ++
49.1363 ++// You should have received a copy of the GNU General Public License along
49.1364 ++// with this library; see the file COPYING. If not, write to the Free
49.1365 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.1366 ++// USA.
49.1367 ++
49.1368 ++// As a special exception, you may use this file as part of a free software
49.1369 ++// library without restriction. Specifically, if other files instantiate
49.1370 ++// templates or use macros or inline functions from this file, or you compile
49.1371 ++// this file and link it with other files to produce an executable, this
49.1372 ++// file does not by itself cause the resulting executable to be covered by
49.1373 ++// the GNU General Public License. This exception does not however
49.1374 ++// invalidate any other reasons why the executable file might be covered by
49.1375 ++// the GNU General Public License.
49.1376 ++
49.1377 ++//
49.1378 ++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
49.1379 ++//
49.1380 ++
49.1381 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.1382 ++
49.1383 ++#define _LIBC
49.1384 ++#include <locale>
49.1385 ++#undef _LIBC
49.1386 ++#include <bits/c++locale_internal.h>
49.1387 ++
49.1388 ++#ifdef __UCLIBC_MJN3_ONLY__
49.1389 ++#warning optimize this for uclibc
49.1390 ++#warning tailor for stub locale support
49.1391 ++#endif
49.1392 ++
49.1393 ++#ifndef __UCLIBC_HAS_XLOCALE__
49.1394 ++#define __nl_langinfo_l(N, L) nl_langinfo((N))
49.1395 ++#endif
49.1396 ++
49.1397 ++namespace std
49.1398 ++{
49.1399 ++ // Construct and return valid pattern consisting of some combination of:
49.1400 ++ // space none symbol sign value
49.1401 ++ money_base::pattern
49.1402 ++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
49.1403 ++ {
49.1404 ++ pattern __ret;
49.1405 ++
49.1406 ++ // This insanely complicated routine attempts to construct a valid
49.1407 ++ // pattern for use with monyepunct. A couple of invariants:
49.1408 ++
49.1409 ++ // if (__precedes) symbol -> value
49.1410 ++ // else value -> symbol
49.1411 ++
49.1412 ++ // if (__space) space
49.1413 ++ // else none
49.1414 ++
49.1415 ++ // none == never first
49.1416 ++ // space never first or last
49.1417 ++
49.1418 ++ // Any elegant implementations of this are welcome.
49.1419 ++ switch (__posn)
49.1420 ++ {
49.1421 ++ case 0:
49.1422 ++ case 1:
49.1423 ++ // 1 The sign precedes the value and symbol.
49.1424 ++ __ret.field[0] = sign;
49.1425 ++ if (__space)
49.1426 ++ {
49.1427 ++ // Pattern starts with sign.
49.1428 ++ if (__precedes)
49.1429 ++ {
49.1430 ++ __ret.field[1] = symbol;
49.1431 ++ __ret.field[3] = value;
49.1432 ++ }
49.1433 ++ else
49.1434 ++ {
49.1435 ++ __ret.field[1] = value;
49.1436 ++ __ret.field[3] = symbol;
49.1437 ++ }
49.1438 ++ __ret.field[2] = space;
49.1439 ++ }
49.1440 ++ else
49.1441 ++ {
49.1442 ++ // Pattern starts with sign and ends with none.
49.1443 ++ if (__precedes)
49.1444 ++ {
49.1445 ++ __ret.field[1] = symbol;
49.1446 ++ __ret.field[2] = value;
49.1447 ++ }
49.1448 ++ else
49.1449 ++ {
49.1450 ++ __ret.field[1] = value;
49.1451 ++ __ret.field[2] = symbol;
49.1452 ++ }
49.1453 ++ __ret.field[3] = none;
49.1454 ++ }
49.1455 ++ break;
49.1456 ++ case 2:
49.1457 ++ // 2 The sign follows the value and symbol.
49.1458 ++ if (__space)
49.1459 ++ {
49.1460 ++ // Pattern either ends with sign.
49.1461 ++ if (__precedes)
49.1462 ++ {
49.1463 ++ __ret.field[0] = symbol;
49.1464 ++ __ret.field[2] = value;
49.1465 ++ }
49.1466 ++ else
49.1467 ++ {
49.1468 ++ __ret.field[0] = value;
49.1469 ++ __ret.field[2] = symbol;
49.1470 ++ }
49.1471 ++ __ret.field[1] = space;
49.1472 ++ __ret.field[3] = sign;
49.1473 ++ }
49.1474 ++ else
49.1475 ++ {
49.1476 ++ // Pattern ends with sign then none.
49.1477 ++ if (__precedes)
49.1478 ++ {
49.1479 ++ __ret.field[0] = symbol;
49.1480 ++ __ret.field[1] = value;
49.1481 ++ }
49.1482 ++ else
49.1483 ++ {
49.1484 ++ __ret.field[0] = value;
49.1485 ++ __ret.field[1] = symbol;
49.1486 ++ }
49.1487 ++ __ret.field[2] = sign;
49.1488 ++ __ret.field[3] = none;
49.1489 ++ }
49.1490 ++ break;
49.1491 ++ case 3:
49.1492 ++ // 3 The sign immediately precedes the symbol.
49.1493 ++ if (__precedes)
49.1494 ++ {
49.1495 ++ __ret.field[0] = sign;
49.1496 ++ __ret.field[1] = symbol;
49.1497 ++ if (__space)
49.1498 ++ {
49.1499 ++ __ret.field[2] = space;
49.1500 ++ __ret.field[3] = value;
49.1501 ++ }
49.1502 ++ else
49.1503 ++ {
49.1504 ++ __ret.field[2] = value;
49.1505 ++ __ret.field[3] = none;
49.1506 ++ }
49.1507 ++ }
49.1508 ++ else
49.1509 ++ {
49.1510 ++ __ret.field[0] = value;
49.1511 ++ if (__space)
49.1512 ++ {
49.1513 ++ __ret.field[1] = space;
49.1514 ++ __ret.field[2] = sign;
49.1515 ++ __ret.field[3] = symbol;
49.1516 ++ }
49.1517 ++ else
49.1518 ++ {
49.1519 ++ __ret.field[1] = sign;
49.1520 ++ __ret.field[2] = symbol;
49.1521 ++ __ret.field[3] = none;
49.1522 ++ }
49.1523 ++ }
49.1524 ++ break;
49.1525 ++ case 4:
49.1526 ++ // 4 The sign immediately follows the symbol.
49.1527 ++ if (__precedes)
49.1528 ++ {
49.1529 ++ __ret.field[0] = symbol;
49.1530 ++ __ret.field[1] = sign;
49.1531 ++ if (__space)
49.1532 ++ {
49.1533 ++ __ret.field[2] = space;
49.1534 ++ __ret.field[3] = value;
49.1535 ++ }
49.1536 ++ else
49.1537 ++ {
49.1538 ++ __ret.field[2] = value;
49.1539 ++ __ret.field[3] = none;
49.1540 ++ }
49.1541 ++ }
49.1542 ++ else
49.1543 ++ {
49.1544 ++ __ret.field[0] = value;
49.1545 ++ if (__space)
49.1546 ++ {
49.1547 ++ __ret.field[1] = space;
49.1548 ++ __ret.field[2] = symbol;
49.1549 ++ __ret.field[3] = sign;
49.1550 ++ }
49.1551 ++ else
49.1552 ++ {
49.1553 ++ __ret.field[1] = symbol;
49.1554 ++ __ret.field[2] = sign;
49.1555 ++ __ret.field[3] = none;
49.1556 ++ }
49.1557 ++ }
49.1558 ++ break;
49.1559 ++ default:
49.1560 ++ ;
49.1561 ++ }
49.1562 ++ return __ret;
49.1563 ++ }
49.1564 ++
49.1565 ++ template<>
49.1566 ++ void
49.1567 ++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
49.1568 ++ const char*)
49.1569 ++ {
49.1570 ++ if (!_M_data)
49.1571 ++ _M_data = new __moneypunct_cache<char, true>;
49.1572 ++
49.1573 ++ if (!__cloc)
49.1574 ++ {
49.1575 ++ // "C" locale
49.1576 ++ _M_data->_M_decimal_point = '.';
49.1577 ++ _M_data->_M_thousands_sep = ',';
49.1578 ++ _M_data->_M_grouping = "";
49.1579 ++ _M_data->_M_grouping_size = 0;
49.1580 ++ _M_data->_M_curr_symbol = "";
49.1581 ++ _M_data->_M_curr_symbol_size = 0;
49.1582 ++ _M_data->_M_positive_sign = "";
49.1583 ++ _M_data->_M_positive_sign_size = 0;
49.1584 ++ _M_data->_M_negative_sign = "";
49.1585 ++ _M_data->_M_negative_sign_size = 0;
49.1586 ++ _M_data->_M_frac_digits = 0;
49.1587 ++ _M_data->_M_pos_format = money_base::_S_default_pattern;
49.1588 ++ _M_data->_M_neg_format = money_base::_S_default_pattern;
49.1589 ++
49.1590 ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
49.1591 ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
49.1592 ++ }
49.1593 ++ else
49.1594 ++ {
49.1595 ++ // Named locale.
49.1596 ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
49.1597 ++ __cloc));
49.1598 ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
49.1599 ++ __cloc));
49.1600 ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
49.1601 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
49.1602 ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
49.1603 ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
49.1604 ++
49.1605 ++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
49.1606 ++ if (!__nposn)
49.1607 ++ _M_data->_M_negative_sign = "()";
49.1608 ++ else
49.1609 ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
49.1610 ++ __cloc);
49.1611 ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
49.1612 ++
49.1613 ++ // _Intl == true
49.1614 ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
49.1615 ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
49.1616 ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
49.1617 ++ __cloc));
49.1618 ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
49.1619 ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
49.1620 ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
49.1621 ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
49.1622 ++ __pposn);
49.1623 ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
49.1624 ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
49.1625 ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
49.1626 ++ __nposn);
49.1627 ++ }
49.1628 ++ }
49.1629 ++
49.1630 ++ template<>
49.1631 ++ void
49.1632 ++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
49.1633 ++ const char*)
49.1634 ++ {
49.1635 ++ if (!_M_data)
49.1636 ++ _M_data = new __moneypunct_cache<char, false>;
49.1637 ++
49.1638 ++ if (!__cloc)
49.1639 ++ {
49.1640 ++ // "C" locale
49.1641 ++ _M_data->_M_decimal_point = '.';
49.1642 ++ _M_data->_M_thousands_sep = ',';
49.1643 ++ _M_data->_M_grouping = "";
49.1644 ++ _M_data->_M_grouping_size = 0;
49.1645 ++ _M_data->_M_curr_symbol = "";
49.1646 ++ _M_data->_M_curr_symbol_size = 0;
49.1647 ++ _M_data->_M_positive_sign = "";
49.1648 ++ _M_data->_M_positive_sign_size = 0;
49.1649 ++ _M_data->_M_negative_sign = "";
49.1650 ++ _M_data->_M_negative_sign_size = 0;
49.1651 ++ _M_data->_M_frac_digits = 0;
49.1652 ++ _M_data->_M_pos_format = money_base::_S_default_pattern;
49.1653 ++ _M_data->_M_neg_format = money_base::_S_default_pattern;
49.1654 ++
49.1655 ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
49.1656 ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
49.1657 ++ }
49.1658 ++ else
49.1659 ++ {
49.1660 ++ // Named locale.
49.1661 ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
49.1662 ++ __cloc));
49.1663 ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
49.1664 ++ __cloc));
49.1665 ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
49.1666 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
49.1667 ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
49.1668 ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
49.1669 ++
49.1670 ++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
49.1671 ++ if (!__nposn)
49.1672 ++ _M_data->_M_negative_sign = "()";
49.1673 ++ else
49.1674 ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
49.1675 ++ __cloc);
49.1676 ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
49.1677 ++
49.1678 ++ // _Intl == false
49.1679 ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
49.1680 ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
49.1681 ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
49.1682 ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
49.1683 ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
49.1684 ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
49.1685 ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
49.1686 ++ __pposn);
49.1687 ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
49.1688 ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
49.1689 ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
49.1690 ++ __nposn);
49.1691 ++ }
49.1692 ++ }
49.1693 ++
49.1694 ++ template<>
49.1695 ++ moneypunct<char, true>::~moneypunct()
49.1696 ++ { delete _M_data; }
49.1697 ++
49.1698 ++ template<>
49.1699 ++ moneypunct<char, false>::~moneypunct()
49.1700 ++ { delete _M_data; }
49.1701 ++
49.1702 ++#ifdef _GLIBCXX_USE_WCHAR_T
49.1703 ++ template<>
49.1704 ++ void
49.1705 ++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
49.1706 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1707 ++ const char*)
49.1708 ++#else
49.1709 ++ const char* __name)
49.1710 ++#endif
49.1711 ++ {
49.1712 ++ if (!_M_data)
49.1713 ++ _M_data = new __moneypunct_cache<wchar_t, true>;
49.1714 ++
49.1715 ++ if (!__cloc)
49.1716 ++ {
49.1717 ++ // "C" locale
49.1718 ++ _M_data->_M_decimal_point = L'.';
49.1719 ++ _M_data->_M_thousands_sep = L',';
49.1720 ++ _M_data->_M_grouping = "";
49.1721 ++ _M_data->_M_grouping_size = 0;
49.1722 ++ _M_data->_M_curr_symbol = L"";
49.1723 ++ _M_data->_M_curr_symbol_size = 0;
49.1724 ++ _M_data->_M_positive_sign = L"";
49.1725 ++ _M_data->_M_positive_sign_size = 0;
49.1726 ++ _M_data->_M_negative_sign = L"";
49.1727 ++ _M_data->_M_negative_sign_size = 0;
49.1728 ++ _M_data->_M_frac_digits = 0;
49.1729 ++ _M_data->_M_pos_format = money_base::_S_default_pattern;
49.1730 ++ _M_data->_M_neg_format = money_base::_S_default_pattern;
49.1731 ++
49.1732 ++ // Use ctype::widen code without the facet...
49.1733 ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
49.1734 ++ _M_data->_M_atoms[__i] =
49.1735 ++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
49.1736 ++ }
49.1737 ++ else
49.1738 ++ {
49.1739 ++ // Named locale.
49.1740 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1741 ++ __c_locale __old = __uselocale(__cloc);
49.1742 ++#else
49.1743 ++ // Switch to named locale so that mbsrtowcs will work.
49.1744 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
49.1745 ++ setlocale(LC_ALL, __name);
49.1746 ++#endif
49.1747 ++
49.1748 ++#ifdef __UCLIBC_MJN3_ONLY__
49.1749 ++#warning fix this... should be monetary
49.1750 ++#endif
49.1751 ++#ifdef __UCLIBC__
49.1752 ++# ifdef __UCLIBC_HAS_XLOCALE__
49.1753 ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
49.1754 ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
49.1755 ++# else
49.1756 ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
49.1757 ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
49.1758 ++# endif
49.1759 ++#else
49.1760 ++ union { char *__s; wchar_t __w; } __u;
49.1761 ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
49.1762 ++ _M_data->_M_decimal_point = __u.__w;
49.1763 ++
49.1764 ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
49.1765 ++ _M_data->_M_thousands_sep = __u.__w;
49.1766 ++#endif
49.1767 ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
49.1768 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
49.1769 ++
49.1770 ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
49.1771 ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
49.1772 ++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
49.1773 ++
49.1774 ++ wchar_t* __wcs_ps = 0;
49.1775 ++ wchar_t* __wcs_ns = 0;
49.1776 ++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
49.1777 ++ try
49.1778 ++ {
49.1779 ++ mbstate_t __state;
49.1780 ++ size_t __len = strlen(__cpossign);
49.1781 ++ if (__len)
49.1782 ++ {
49.1783 ++ ++__len;
49.1784 ++ memset(&__state, 0, sizeof(mbstate_t));
49.1785 ++ __wcs_ps = new wchar_t[__len];
49.1786 ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
49.1787 ++ _M_data->_M_positive_sign = __wcs_ps;
49.1788 ++ }
49.1789 ++ else
49.1790 ++ _M_data->_M_positive_sign = L"";
49.1791 ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
49.1792 ++
49.1793 ++ __len = strlen(__cnegsign);
49.1794 ++ if (!__nposn)
49.1795 ++ _M_data->_M_negative_sign = L"()";
49.1796 ++ else if (__len)
49.1797 ++ {
49.1798 ++ ++__len;
49.1799 ++ memset(&__state, 0, sizeof(mbstate_t));
49.1800 ++ __wcs_ns = new wchar_t[__len];
49.1801 ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
49.1802 ++ _M_data->_M_negative_sign = __wcs_ns;
49.1803 ++ }
49.1804 ++ else
49.1805 ++ _M_data->_M_negative_sign = L"";
49.1806 ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
49.1807 ++
49.1808 ++ // _Intl == true.
49.1809 ++ __len = strlen(__ccurr);
49.1810 ++ if (__len)
49.1811 ++ {
49.1812 ++ ++__len;
49.1813 ++ memset(&__state, 0, sizeof(mbstate_t));
49.1814 ++ wchar_t* __wcs = new wchar_t[__len];
49.1815 ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
49.1816 ++ _M_data->_M_curr_symbol = __wcs;
49.1817 ++ }
49.1818 ++ else
49.1819 ++ _M_data->_M_curr_symbol = L"";
49.1820 ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
49.1821 ++ }
49.1822 ++ catch (...)
49.1823 ++ {
49.1824 ++ delete _M_data;
49.1825 ++ _M_data = 0;
49.1826 ++ delete __wcs_ps;
49.1827 ++ delete __wcs_ns;
49.1828 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1829 ++ __uselocale(__old);
49.1830 ++#else
49.1831 ++ setlocale(LC_ALL, __old);
49.1832 ++ free(__old);
49.1833 ++#endif
49.1834 ++ __throw_exception_again;
49.1835 ++ }
49.1836 ++
49.1837 ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
49.1838 ++ __cloc));
49.1839 ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
49.1840 ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
49.1841 ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
49.1842 ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
49.1843 ++ __pposn);
49.1844 ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
49.1845 ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
49.1846 ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
49.1847 ++ __nposn);
49.1848 ++
49.1849 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1850 ++ __uselocale(__old);
49.1851 ++#else
49.1852 ++ setlocale(LC_ALL, __old);
49.1853 ++ free(__old);
49.1854 ++#endif
49.1855 ++ }
49.1856 ++ }
49.1857 ++
49.1858 ++ template<>
49.1859 ++ void
49.1860 ++ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
49.1861 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1862 ++ const char*)
49.1863 ++#else
49.1864 ++ const char* __name)
49.1865 ++#endif
49.1866 ++ {
49.1867 ++ if (!_M_data)
49.1868 ++ _M_data = new __moneypunct_cache<wchar_t, false>;
49.1869 ++
49.1870 ++ if (!__cloc)
49.1871 ++ {
49.1872 ++ // "C" locale
49.1873 ++ _M_data->_M_decimal_point = L'.';
49.1874 ++ _M_data->_M_thousands_sep = L',';
49.1875 ++ _M_data->_M_grouping = "";
49.1876 ++ _M_data->_M_grouping_size = 0;
49.1877 ++ _M_data->_M_curr_symbol = L"";
49.1878 ++ _M_data->_M_curr_symbol_size = 0;
49.1879 ++ _M_data->_M_positive_sign = L"";
49.1880 ++ _M_data->_M_positive_sign_size = 0;
49.1881 ++ _M_data->_M_negative_sign = L"";
49.1882 ++ _M_data->_M_negative_sign_size = 0;
49.1883 ++ _M_data->_M_frac_digits = 0;
49.1884 ++ _M_data->_M_pos_format = money_base::_S_default_pattern;
49.1885 ++ _M_data->_M_neg_format = money_base::_S_default_pattern;
49.1886 ++
49.1887 ++ // Use ctype::widen code without the facet...
49.1888 ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
49.1889 ++ _M_data->_M_atoms[__i] =
49.1890 ++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
49.1891 ++ }
49.1892 ++ else
49.1893 ++ {
49.1894 ++ // Named locale.
49.1895 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1896 ++ __c_locale __old = __uselocale(__cloc);
49.1897 ++#else
49.1898 ++ // Switch to named locale so that mbsrtowcs will work.
49.1899 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
49.1900 ++ setlocale(LC_ALL, __name);
49.1901 ++#endif
49.1902 ++
49.1903 ++#ifdef __UCLIBC_MJN3_ONLY__
49.1904 ++#warning fix this... should be monetary
49.1905 ++#endif
49.1906 ++#ifdef __UCLIBC__
49.1907 ++# ifdef __UCLIBC_HAS_XLOCALE__
49.1908 ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
49.1909 ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
49.1910 ++# else
49.1911 ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
49.1912 ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
49.1913 ++# endif
49.1914 ++#else
49.1915 ++ union { char *__s; wchar_t __w; } __u;
49.1916 ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
49.1917 ++ _M_data->_M_decimal_point = __u.__w;
49.1918 ++
49.1919 ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
49.1920 ++ _M_data->_M_thousands_sep = __u.__w;
49.1921 ++#endif
49.1922 ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
49.1923 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
49.1924 ++
49.1925 ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
49.1926 ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
49.1927 ++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
49.1928 ++
49.1929 ++ wchar_t* __wcs_ps = 0;
49.1930 ++ wchar_t* __wcs_ns = 0;
49.1931 ++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
49.1932 ++ try
49.1933 ++ {
49.1934 ++ mbstate_t __state;
49.1935 ++ size_t __len;
49.1936 ++ __len = strlen(__cpossign);
49.1937 ++ if (__len)
49.1938 ++ {
49.1939 ++ ++__len;
49.1940 ++ memset(&__state, 0, sizeof(mbstate_t));
49.1941 ++ __wcs_ps = new wchar_t[__len];
49.1942 ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
49.1943 ++ _M_data->_M_positive_sign = __wcs_ps;
49.1944 ++ }
49.1945 ++ else
49.1946 ++ _M_data->_M_positive_sign = L"";
49.1947 ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
49.1948 ++
49.1949 ++ __len = strlen(__cnegsign);
49.1950 ++ if (!__nposn)
49.1951 ++ _M_data->_M_negative_sign = L"()";
49.1952 ++ else if (__len)
49.1953 ++ {
49.1954 ++ ++__len;
49.1955 ++ memset(&__state, 0, sizeof(mbstate_t));
49.1956 ++ __wcs_ns = new wchar_t[__len];
49.1957 ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
49.1958 ++ _M_data->_M_negative_sign = __wcs_ns;
49.1959 ++ }
49.1960 ++ else
49.1961 ++ _M_data->_M_negative_sign = L"";
49.1962 ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
49.1963 ++
49.1964 ++ // _Intl == true.
49.1965 ++ __len = strlen(__ccurr);
49.1966 ++ if (__len)
49.1967 ++ {
49.1968 ++ ++__len;
49.1969 ++ memset(&__state, 0, sizeof(mbstate_t));
49.1970 ++ wchar_t* __wcs = new wchar_t[__len];
49.1971 ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
49.1972 ++ _M_data->_M_curr_symbol = __wcs;
49.1973 ++ }
49.1974 ++ else
49.1975 ++ _M_data->_M_curr_symbol = L"";
49.1976 ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
49.1977 ++ }
49.1978 ++ catch (...)
49.1979 ++ {
49.1980 ++ delete _M_data;
49.1981 ++ _M_data = 0;
49.1982 ++ delete __wcs_ps;
49.1983 ++ delete __wcs_ns;
49.1984 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.1985 ++ __uselocale(__old);
49.1986 ++#else
49.1987 ++ setlocale(LC_ALL, __old);
49.1988 ++ free(__old);
49.1989 ++#endif
49.1990 ++ __throw_exception_again;
49.1991 ++ }
49.1992 ++
49.1993 ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
49.1994 ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
49.1995 ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
49.1996 ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
49.1997 ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
49.1998 ++ __pposn);
49.1999 ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
49.2000 ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
49.2001 ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
49.2002 ++ __nposn);
49.2003 ++
49.2004 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.2005 ++ __uselocale(__old);
49.2006 ++#else
49.2007 ++ setlocale(LC_ALL, __old);
49.2008 ++ free(__old);
49.2009 ++#endif
49.2010 ++ }
49.2011 ++ }
49.2012 ++
49.2013 ++ template<>
49.2014 ++ moneypunct<wchar_t, true>::~moneypunct()
49.2015 ++ {
49.2016 ++ if (_M_data->_M_positive_sign_size)
49.2017 ++ delete [] _M_data->_M_positive_sign;
49.2018 ++ if (_M_data->_M_negative_sign_size
49.2019 ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
49.2020 ++ delete [] _M_data->_M_negative_sign;
49.2021 ++ if (_M_data->_M_curr_symbol_size)
49.2022 ++ delete [] _M_data->_M_curr_symbol;
49.2023 ++ delete _M_data;
49.2024 ++ }
49.2025 ++
49.2026 ++ template<>
49.2027 ++ moneypunct<wchar_t, false>::~moneypunct()
49.2028 ++ {
49.2029 ++ if (_M_data->_M_positive_sign_size)
49.2030 ++ delete [] _M_data->_M_positive_sign;
49.2031 ++ if (_M_data->_M_negative_sign_size
49.2032 ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
49.2033 ++ delete [] _M_data->_M_negative_sign;
49.2034 ++ if (_M_data->_M_curr_symbol_size)
49.2035 ++ delete [] _M_data->_M_curr_symbol;
49.2036 ++ delete _M_data;
49.2037 ++ }
49.2038 ++#endif
49.2039 ++}
49.2040 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
49.2041 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100
49.2042 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:39.000000000 +0200
49.2043 +@@ -0,0 +1,160 @@
49.2044 ++// std::numpunct implementation details, GNU version -*- C++ -*-
49.2045 ++
49.2046 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
49.2047 ++//
49.2048 ++// This file is part of the GNU ISO C++ Library. This library is free
49.2049 ++// software; you can redistribute it and/or modify it under the
49.2050 ++// terms of the GNU General Public License as published by the
49.2051 ++// Free Software Foundation; either version 2, or (at your option)
49.2052 ++// any later version.
49.2053 ++
49.2054 ++// This library is distributed in the hope that it will be useful,
49.2055 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.2056 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.2057 ++// GNU General Public License for more details.
49.2058 ++
49.2059 ++// You should have received a copy of the GNU General Public License along
49.2060 ++// with this library; see the file COPYING. If not, write to the Free
49.2061 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.2062 ++// USA.
49.2063 ++
49.2064 ++// As a special exception, you may use this file as part of a free software
49.2065 ++// library without restriction. Specifically, if other files instantiate
49.2066 ++// templates or use macros or inline functions from this file, or you compile
49.2067 ++// this file and link it with other files to produce an executable, this
49.2068 ++// file does not by itself cause the resulting executable to be covered by
49.2069 ++// the GNU General Public License. This exception does not however
49.2070 ++// invalidate any other reasons why the executable file might be covered by
49.2071 ++// the GNU General Public License.
49.2072 ++
49.2073 ++//
49.2074 ++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
49.2075 ++//
49.2076 ++
49.2077 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.2078 ++
49.2079 ++#define _LIBC
49.2080 ++#include <locale>
49.2081 ++#undef _LIBC
49.2082 ++#include <bits/c++locale_internal.h>
49.2083 ++
49.2084 ++#ifdef __UCLIBC_MJN3_ONLY__
49.2085 ++#warning tailor for stub locale support
49.2086 ++#endif
49.2087 ++#ifndef __UCLIBC_HAS_XLOCALE__
49.2088 ++#define __nl_langinfo_l(N, L) nl_langinfo((N))
49.2089 ++#endif
49.2090 ++
49.2091 ++namespace std
49.2092 ++{
49.2093 ++ template<>
49.2094 ++ void
49.2095 ++ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
49.2096 ++ {
49.2097 ++ if (!_M_data)
49.2098 ++ _M_data = new __numpunct_cache<char>;
49.2099 ++
49.2100 ++ if (!__cloc)
49.2101 ++ {
49.2102 ++ // "C" locale
49.2103 ++ _M_data->_M_grouping = "";
49.2104 ++ _M_data->_M_grouping_size = 0;
49.2105 ++ _M_data->_M_use_grouping = false;
49.2106 ++
49.2107 ++ _M_data->_M_decimal_point = '.';
49.2108 ++ _M_data->_M_thousands_sep = ',';
49.2109 ++
49.2110 ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
49.2111 ++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
49.2112 ++
49.2113 ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
49.2114 ++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
49.2115 ++ }
49.2116 ++ else
49.2117 ++ {
49.2118 ++ // Named locale.
49.2119 ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
49.2120 ++ __cloc));
49.2121 ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
49.2122 ++ __cloc));
49.2123 ++
49.2124 ++ // Check for NULL, which implies no grouping.
49.2125 ++ if (_M_data->_M_thousands_sep == '\0')
49.2126 ++ _M_data->_M_grouping = "";
49.2127 ++ else
49.2128 ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
49.2129 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
49.2130 ++ }
49.2131 ++
49.2132 ++ // NB: There is no way to extact this info from posix locales.
49.2133 ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
49.2134 ++ _M_data->_M_truename = "true";
49.2135 ++ _M_data->_M_truename_size = 4;
49.2136 ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
49.2137 ++ _M_data->_M_falsename = "false";
49.2138 ++ _M_data->_M_falsename_size = 5;
49.2139 ++ }
49.2140 ++
49.2141 ++ template<>
49.2142 ++ numpunct<char>::~numpunct()
49.2143 ++ { delete _M_data; }
49.2144 ++
49.2145 ++#ifdef _GLIBCXX_USE_WCHAR_T
49.2146 ++ template<>
49.2147 ++ void
49.2148 ++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
49.2149 ++ {
49.2150 ++ if (!_M_data)
49.2151 ++ _M_data = new __numpunct_cache<wchar_t>;
49.2152 ++
49.2153 ++ if (!__cloc)
49.2154 ++ {
49.2155 ++ // "C" locale
49.2156 ++ _M_data->_M_grouping = "";
49.2157 ++ _M_data->_M_grouping_size = 0;
49.2158 ++ _M_data->_M_use_grouping = false;
49.2159 ++
49.2160 ++ _M_data->_M_decimal_point = L'.';
49.2161 ++ _M_data->_M_thousands_sep = L',';
49.2162 ++
49.2163 ++ // Use ctype::widen code without the facet...
49.2164 ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
49.2165 ++ _M_data->_M_atoms_out[__i] =
49.2166 ++ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
49.2167 ++
49.2168 ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
49.2169 ++ _M_data->_M_atoms_in[__j] =
49.2170 ++ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
49.2171 ++ }
49.2172 ++ else
49.2173 ++ {
49.2174 ++ // Named locale.
49.2175 ++ // NB: In the GNU model wchar_t is always 32 bit wide.
49.2176 ++ union { char *__s; wchar_t __w; } __u;
49.2177 ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
49.2178 ++ _M_data->_M_decimal_point = __u.__w;
49.2179 ++
49.2180 ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
49.2181 ++ _M_data->_M_thousands_sep = __u.__w;
49.2182 ++
49.2183 ++ if (_M_data->_M_thousands_sep == L'\0')
49.2184 ++ _M_data->_M_grouping = "";
49.2185 ++ else
49.2186 ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
49.2187 ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
49.2188 ++ }
49.2189 ++
49.2190 ++ // NB: There is no way to extact this info from posix locales.
49.2191 ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
49.2192 ++ _M_data->_M_truename = L"true";
49.2193 ++ _M_data->_M_truename_size = 4;
49.2194 ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
49.2195 ++ _M_data->_M_falsename = L"false";
49.2196 ++ _M_data->_M_falsename_size = 5;
49.2197 ++ }
49.2198 ++
49.2199 ++ template<>
49.2200 ++ numpunct<wchar_t>::~numpunct()
49.2201 ++ { delete _M_data; }
49.2202 ++ #endif
49.2203 ++}
49.2204 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
49.2205 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100
49.2206 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:39.000000000 +0200
49.2207 +@@ -0,0 +1,406 @@
49.2208 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
49.2209 ++
49.2210 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
49.2211 ++//
49.2212 ++// This file is part of the GNU ISO C++ Library. This library is free
49.2213 ++// software; you can redistribute it and/or modify it under the
49.2214 ++// terms of the GNU General Public License as published by the
49.2215 ++// Free Software Foundation; either version 2, or (at your option)
49.2216 ++// any later version.
49.2217 ++
49.2218 ++// This library is distributed in the hope that it will be useful,
49.2219 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.2220 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.2221 ++// GNU General Public License for more details.
49.2222 ++
49.2223 ++// You should have received a copy of the GNU General Public License along
49.2224 ++// with this library; see the file COPYING. If not, write to the Free
49.2225 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.2226 ++// USA.
49.2227 ++
49.2228 ++// As a special exception, you may use this file as part of a free software
49.2229 ++// library without restriction. Specifically, if other files instantiate
49.2230 ++// templates or use macros or inline functions from this file, or you compile
49.2231 ++// this file and link it with other files to produce an executable, this
49.2232 ++// file does not by itself cause the resulting executable to be covered by
49.2233 ++// the GNU General Public License. This exception does not however
49.2234 ++// invalidate any other reasons why the executable file might be covered by
49.2235 ++// the GNU General Public License.
49.2236 ++
49.2237 ++//
49.2238 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
49.2239 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
49.2240 ++//
49.2241 ++
49.2242 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.2243 ++
49.2244 ++#include <locale>
49.2245 ++#include <bits/c++locale_internal.h>
49.2246 ++
49.2247 ++#ifdef __UCLIBC_MJN3_ONLY__
49.2248 ++#warning tailor for stub locale support
49.2249 ++#endif
49.2250 ++#ifndef __UCLIBC_HAS_XLOCALE__
49.2251 ++#define __nl_langinfo_l(N, L) nl_langinfo((N))
49.2252 ++#endif
49.2253 ++
49.2254 ++namespace std
49.2255 ++{
49.2256 ++ template<>
49.2257 ++ void
49.2258 ++ __timepunct<char>::
49.2259 ++ _M_put(char* __s, size_t __maxlen, const char* __format,
49.2260 ++ const tm* __tm) const
49.2261 ++ {
49.2262 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.2263 ++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
49.2264 ++ _M_c_locale_timepunct);
49.2265 ++#else
49.2266 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
49.2267 ++ setlocale(LC_ALL, _M_name_timepunct);
49.2268 ++ const size_t __len = strftime(__s, __maxlen, __format, __tm);
49.2269 ++ setlocale(LC_ALL, __old);
49.2270 ++ free(__old);
49.2271 ++#endif
49.2272 ++ // Make sure __s is null terminated.
49.2273 ++ if (__len == 0)
49.2274 ++ __s[0] = '\0';
49.2275 ++ }
49.2276 ++
49.2277 ++ template<>
49.2278 ++ void
49.2279 ++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
49.2280 ++ {
49.2281 ++ if (!_M_data)
49.2282 ++ _M_data = new __timepunct_cache<char>;
49.2283 ++
49.2284 ++ if (!__cloc)
49.2285 ++ {
49.2286 ++ // "C" locale
49.2287 ++ _M_c_locale_timepunct = _S_get_c_locale();
49.2288 ++
49.2289 ++ _M_data->_M_date_format = "%m/%d/%y";
49.2290 ++ _M_data->_M_date_era_format = "%m/%d/%y";
49.2291 ++ _M_data->_M_time_format = "%H:%M:%S";
49.2292 ++ _M_data->_M_time_era_format = "%H:%M:%S";
49.2293 ++ _M_data->_M_date_time_format = "";
49.2294 ++ _M_data->_M_date_time_era_format = "";
49.2295 ++ _M_data->_M_am = "AM";
49.2296 ++ _M_data->_M_pm = "PM";
49.2297 ++ _M_data->_M_am_pm_format = "";
49.2298 ++
49.2299 ++ // Day names, starting with "C"'s Sunday.
49.2300 ++ _M_data->_M_day1 = "Sunday";
49.2301 ++ _M_data->_M_day2 = "Monday";
49.2302 ++ _M_data->_M_day3 = "Tuesday";
49.2303 ++ _M_data->_M_day4 = "Wednesday";
49.2304 ++ _M_data->_M_day5 = "Thursday";
49.2305 ++ _M_data->_M_day6 = "Friday";
49.2306 ++ _M_data->_M_day7 = "Saturday";
49.2307 ++
49.2308 ++ // Abbreviated day names, starting with "C"'s Sun.
49.2309 ++ _M_data->_M_aday1 = "Sun";
49.2310 ++ _M_data->_M_aday2 = "Mon";
49.2311 ++ _M_data->_M_aday3 = "Tue";
49.2312 ++ _M_data->_M_aday4 = "Wed";
49.2313 ++ _M_data->_M_aday5 = "Thu";
49.2314 ++ _M_data->_M_aday6 = "Fri";
49.2315 ++ _M_data->_M_aday7 = "Sat";
49.2316 ++
49.2317 ++ // Month names, starting with "C"'s January.
49.2318 ++ _M_data->_M_month01 = "January";
49.2319 ++ _M_data->_M_month02 = "February";
49.2320 ++ _M_data->_M_month03 = "March";
49.2321 ++ _M_data->_M_month04 = "April";
49.2322 ++ _M_data->_M_month05 = "May";
49.2323 ++ _M_data->_M_month06 = "June";
49.2324 ++ _M_data->_M_month07 = "July";
49.2325 ++ _M_data->_M_month08 = "August";
49.2326 ++ _M_data->_M_month09 = "September";
49.2327 ++ _M_data->_M_month10 = "October";
49.2328 ++ _M_data->_M_month11 = "November";
49.2329 ++ _M_data->_M_month12 = "December";
49.2330 ++
49.2331 ++ // Abbreviated month names, starting with "C"'s Jan.
49.2332 ++ _M_data->_M_amonth01 = "Jan";
49.2333 ++ _M_data->_M_amonth02 = "Feb";
49.2334 ++ _M_data->_M_amonth03 = "Mar";
49.2335 ++ _M_data->_M_amonth04 = "Apr";
49.2336 ++ _M_data->_M_amonth05 = "May";
49.2337 ++ _M_data->_M_amonth06 = "Jun";
49.2338 ++ _M_data->_M_amonth07 = "Jul";
49.2339 ++ _M_data->_M_amonth08 = "Aug";
49.2340 ++ _M_data->_M_amonth09 = "Sep";
49.2341 ++ _M_data->_M_amonth10 = "Oct";
49.2342 ++ _M_data->_M_amonth11 = "Nov";
49.2343 ++ _M_data->_M_amonth12 = "Dec";
49.2344 ++ }
49.2345 ++ else
49.2346 ++ {
49.2347 ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
49.2348 ++
49.2349 ++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
49.2350 ++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
49.2351 ++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
49.2352 ++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
49.2353 ++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
49.2354 ++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
49.2355 ++ __cloc);
49.2356 ++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
49.2357 ++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
49.2358 ++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
49.2359 ++
49.2360 ++ // Day names, starting with "C"'s Sunday.
49.2361 ++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
49.2362 ++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
49.2363 ++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
49.2364 ++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
49.2365 ++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
49.2366 ++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
49.2367 ++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
49.2368 ++
49.2369 ++ // Abbreviated day names, starting with "C"'s Sun.
49.2370 ++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
49.2371 ++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
49.2372 ++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
49.2373 ++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
49.2374 ++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
49.2375 ++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
49.2376 ++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
49.2377 ++
49.2378 ++ // Month names, starting with "C"'s January.
49.2379 ++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
49.2380 ++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
49.2381 ++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
49.2382 ++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
49.2383 ++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
49.2384 ++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
49.2385 ++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
49.2386 ++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
49.2387 ++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
49.2388 ++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
49.2389 ++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
49.2390 ++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
49.2391 ++
49.2392 ++ // Abbreviated month names, starting with "C"'s Jan.
49.2393 ++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
49.2394 ++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
49.2395 ++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
49.2396 ++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
49.2397 ++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
49.2398 ++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
49.2399 ++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
49.2400 ++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
49.2401 ++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
49.2402 ++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
49.2403 ++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
49.2404 ++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
49.2405 ++ }
49.2406 ++ }
49.2407 ++
49.2408 ++#ifdef _GLIBCXX_USE_WCHAR_T
49.2409 ++ template<>
49.2410 ++ void
49.2411 ++ __timepunct<wchar_t>::
49.2412 ++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
49.2413 ++ const tm* __tm) const
49.2414 ++ {
49.2415 ++#ifdef __UCLIBC_HAS_XLOCALE__
49.2416 ++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
49.2417 ++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
49.2418 ++ _M_c_locale_timepunct);
49.2419 ++#else
49.2420 ++ char* __old = strdup(setlocale(LC_ALL, NULL));
49.2421 ++ setlocale(LC_ALL, _M_name_timepunct);
49.2422 ++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
49.2423 ++ setlocale(LC_ALL, __old);
49.2424 ++ free(__old);
49.2425 ++#endif
49.2426 ++ // Make sure __s is null terminated.
49.2427 ++ if (__len == 0)
49.2428 ++ __s[0] = L'\0';
49.2429 ++ }
49.2430 ++
49.2431 ++ template<>
49.2432 ++ void
49.2433 ++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
49.2434 ++ {
49.2435 ++ if (!_M_data)
49.2436 ++ _M_data = new __timepunct_cache<wchar_t>;
49.2437 ++
49.2438 ++#warning wide time stuff
49.2439 ++// if (!__cloc)
49.2440 ++ {
49.2441 ++ // "C" locale
49.2442 ++ _M_c_locale_timepunct = _S_get_c_locale();
49.2443 ++
49.2444 ++ _M_data->_M_date_format = L"%m/%d/%y";
49.2445 ++ _M_data->_M_date_era_format = L"%m/%d/%y";
49.2446 ++ _M_data->_M_time_format = L"%H:%M:%S";
49.2447 ++ _M_data->_M_time_era_format = L"%H:%M:%S";
49.2448 ++ _M_data->_M_date_time_format = L"";
49.2449 ++ _M_data->_M_date_time_era_format = L"";
49.2450 ++ _M_data->_M_am = L"AM";
49.2451 ++ _M_data->_M_pm = L"PM";
49.2452 ++ _M_data->_M_am_pm_format = L"";
49.2453 ++
49.2454 ++ // Day names, starting with "C"'s Sunday.
49.2455 ++ _M_data->_M_day1 = L"Sunday";
49.2456 ++ _M_data->_M_day2 = L"Monday";
49.2457 ++ _M_data->_M_day3 = L"Tuesday";
49.2458 ++ _M_data->_M_day4 = L"Wednesday";
49.2459 ++ _M_data->_M_day5 = L"Thursday";
49.2460 ++ _M_data->_M_day6 = L"Friday";
49.2461 ++ _M_data->_M_day7 = L"Saturday";
49.2462 ++
49.2463 ++ // Abbreviated day names, starting with "C"'s Sun.
49.2464 ++ _M_data->_M_aday1 = L"Sun";
49.2465 ++ _M_data->_M_aday2 = L"Mon";
49.2466 ++ _M_data->_M_aday3 = L"Tue";
49.2467 ++ _M_data->_M_aday4 = L"Wed";
49.2468 ++ _M_data->_M_aday5 = L"Thu";
49.2469 ++ _M_data->_M_aday6 = L"Fri";
49.2470 ++ _M_data->_M_aday7 = L"Sat";
49.2471 ++
49.2472 ++ // Month names, starting with "C"'s January.
49.2473 ++ _M_data->_M_month01 = L"January";
49.2474 ++ _M_data->_M_month02 = L"February";
49.2475 ++ _M_data->_M_month03 = L"March";
49.2476 ++ _M_data->_M_month04 = L"April";
49.2477 ++ _M_data->_M_month05 = L"May";
49.2478 ++ _M_data->_M_month06 = L"June";
49.2479 ++ _M_data->_M_month07 = L"July";
49.2480 ++ _M_data->_M_month08 = L"August";
49.2481 ++ _M_data->_M_month09 = L"September";
49.2482 ++ _M_data->_M_month10 = L"October";
49.2483 ++ _M_data->_M_month11 = L"November";
49.2484 ++ _M_data->_M_month12 = L"December";
49.2485 ++
49.2486 ++ // Abbreviated month names, starting with "C"'s Jan.
49.2487 ++ _M_data->_M_amonth01 = L"Jan";
49.2488 ++ _M_data->_M_amonth02 = L"Feb";
49.2489 ++ _M_data->_M_amonth03 = L"Mar";
49.2490 ++ _M_data->_M_amonth04 = L"Apr";
49.2491 ++ _M_data->_M_amonth05 = L"May";
49.2492 ++ _M_data->_M_amonth06 = L"Jun";
49.2493 ++ _M_data->_M_amonth07 = L"Jul";
49.2494 ++ _M_data->_M_amonth08 = L"Aug";
49.2495 ++ _M_data->_M_amonth09 = L"Sep";
49.2496 ++ _M_data->_M_amonth10 = L"Oct";
49.2497 ++ _M_data->_M_amonth11 = L"Nov";
49.2498 ++ _M_data->_M_amonth12 = L"Dec";
49.2499 ++ }
49.2500 ++#if 0
49.2501 ++ else
49.2502 ++ {
49.2503 ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
49.2504 ++
49.2505 ++ union { char *__s; wchar_t *__w; } __u;
49.2506 ++
49.2507 ++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
49.2508 ++ _M_data->_M_date_format = __u.__w;
49.2509 ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
49.2510 ++ _M_data->_M_date_era_format = __u.__w;
49.2511 ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
49.2512 ++ _M_data->_M_time_format = __u.__w;
49.2513 ++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
49.2514 ++ _M_data->_M_time_era_format = __u.__w;
49.2515 ++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
49.2516 ++ _M_data->_M_date_time_format = __u.__w;
49.2517 ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
49.2518 ++ _M_data->_M_date_time_era_format = __u.__w;
49.2519 ++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
49.2520 ++ _M_data->_M_am = __u.__w;
49.2521 ++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
49.2522 ++ _M_data->_M_pm = __u.__w;
49.2523 ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
49.2524 ++ _M_data->_M_am_pm_format = __u.__w;
49.2525 ++
49.2526 ++ // Day names, starting with "C"'s Sunday.
49.2527 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
49.2528 ++ _M_data->_M_day1 = __u.__w;
49.2529 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
49.2530 ++ _M_data->_M_day2 = __u.__w;
49.2531 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
49.2532 ++ _M_data->_M_day3 = __u.__w;
49.2533 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
49.2534 ++ _M_data->_M_day4 = __u.__w;
49.2535 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
49.2536 ++ _M_data->_M_day5 = __u.__w;
49.2537 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
49.2538 ++ _M_data->_M_day6 = __u.__w;
49.2539 ++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
49.2540 ++ _M_data->_M_day7 = __u.__w;
49.2541 ++
49.2542 ++ // Abbreviated day names, starting with "C"'s Sun.
49.2543 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
49.2544 ++ _M_data->_M_aday1 = __u.__w;
49.2545 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
49.2546 ++ _M_data->_M_aday2 = __u.__w;
49.2547 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
49.2548 ++ _M_data->_M_aday3 = __u.__w;
49.2549 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
49.2550 ++ _M_data->_M_aday4 = __u.__w;
49.2551 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
49.2552 ++ _M_data->_M_aday5 = __u.__w;
49.2553 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
49.2554 ++ _M_data->_M_aday6 = __u.__w;
49.2555 ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
49.2556 ++ _M_data->_M_aday7 = __u.__w;
49.2557 ++
49.2558 ++ // Month names, starting with "C"'s January.
49.2559 ++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
49.2560 ++ _M_data->_M_month01 = __u.__w;
49.2561 ++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
49.2562 ++ _M_data->_M_month02 = __u.__w;
49.2563 ++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
49.2564 ++ _M_data->_M_month03 = __u.__w;
49.2565 ++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
49.2566 ++ _M_data->_M_month04 = __u.__w;
49.2567 ++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
49.2568 ++ _M_data->_M_month05 = __u.__w;
49.2569 ++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
49.2570 ++ _M_data->_M_month06 = __u.__w;
49.2571 ++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
49.2572 ++ _M_data->_M_month07 = __u.__w;
49.2573 ++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
49.2574 ++ _M_data->_M_month08 = __u.__w;
49.2575 ++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
49.2576 ++ _M_data->_M_month09 = __u.__w;
49.2577 ++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
49.2578 ++ _M_data->_M_month10 = __u.__w;
49.2579 ++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
49.2580 ++ _M_data->_M_month11 = __u.__w;
49.2581 ++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
49.2582 ++ _M_data->_M_month12 = __u.__w;
49.2583 ++
49.2584 ++ // Abbreviated month names, starting with "C"'s Jan.
49.2585 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
49.2586 ++ _M_data->_M_amonth01 = __u.__w;
49.2587 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
49.2588 ++ _M_data->_M_amonth02 = __u.__w;
49.2589 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
49.2590 ++ _M_data->_M_amonth03 = __u.__w;
49.2591 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
49.2592 ++ _M_data->_M_amonth04 = __u.__w;
49.2593 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
49.2594 ++ _M_data->_M_amonth05 = __u.__w;
49.2595 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
49.2596 ++ _M_data->_M_amonth06 = __u.__w;
49.2597 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
49.2598 ++ _M_data->_M_amonth07 = __u.__w;
49.2599 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
49.2600 ++ _M_data->_M_amonth08 = __u.__w;
49.2601 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
49.2602 ++ _M_data->_M_amonth09 = __u.__w;
49.2603 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
49.2604 ++ _M_data->_M_amonth10 = __u.__w;
49.2605 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
49.2606 ++ _M_data->_M_amonth11 = __u.__w;
49.2607 ++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
49.2608 ++ _M_data->_M_amonth12 = __u.__w;
49.2609 ++ }
49.2610 ++#endif // 0
49.2611 ++ }
49.2612 ++#endif
49.2613 ++}
49.2614 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
49.2615 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100
49.2616 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:39.000000000 +0200
49.2617 +@@ -0,0 +1,68 @@
49.2618 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
49.2619 ++
49.2620 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
49.2621 ++//
49.2622 ++// This file is part of the GNU ISO C++ Library. This library is free
49.2623 ++// software; you can redistribute it and/or modify it under the
49.2624 ++// terms of the GNU General Public License as published by the
49.2625 ++// Free Software Foundation; either version 2, or (at your option)
49.2626 ++// any later version.
49.2627 ++
49.2628 ++// This library is distributed in the hope that it will be useful,
49.2629 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
49.2630 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49.2631 ++// GNU General Public License for more details.
49.2632 ++
49.2633 ++// You should have received a copy of the GNU General Public License along
49.2634 ++// with this library; see the file COPYING. If not, write to the Free
49.2635 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
49.2636 ++// USA.
49.2637 ++
49.2638 ++// As a special exception, you may use this file as part of a free software
49.2639 ++// library without restriction. Specifically, if other files instantiate
49.2640 ++// templates or use macros or inline functions from this file, or you compile
49.2641 ++// this file and link it with other files to produce an executable, this
49.2642 ++// file does not by itself cause the resulting executable to be covered by
49.2643 ++// the GNU General Public License. This exception does not however
49.2644 ++// invalidate any other reasons why the executable file might be covered by
49.2645 ++// the GNU General Public License.
49.2646 ++
49.2647 ++//
49.2648 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
49.2649 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
49.2650 ++//
49.2651 ++
49.2652 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
49.2653 ++
49.2654 ++ template<typename _CharT>
49.2655 ++ __timepunct<_CharT>::__timepunct(size_t __refs)
49.2656 ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
49.2657 ++ _M_name_timepunct(_S_get_c_name())
49.2658 ++ { _M_initialize_timepunct(); }
49.2659 ++
49.2660 ++ template<typename _CharT>
49.2661 ++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
49.2662 ++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
49.2663 ++ _M_name_timepunct(_S_get_c_name())
49.2664 ++ { _M_initialize_timepunct(); }
49.2665 ++
49.2666 ++ template<typename _CharT>
49.2667 ++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
49.2668 ++ size_t __refs)
49.2669 ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
49.2670 ++ _M_name_timepunct(__s)
49.2671 ++ {
49.2672 ++ char* __tmp = new char[std::strlen(__s) + 1];
49.2673 ++ std::strcpy(__tmp, __s);
49.2674 ++ _M_name_timepunct = __tmp;
49.2675 ++ _M_initialize_timepunct(__cloc);
49.2676 ++ }
49.2677 ++
49.2678 ++ template<typename _CharT>
49.2679 ++ __timepunct<_CharT>::~__timepunct()
49.2680 ++ {
49.2681 ++ if (_M_name_timepunct != _S_get_c_name())
49.2682 ++ delete [] _M_name_timepunct;
49.2683 ++ delete _M_data;
49.2684 ++ _S_destroy_c_locale(_M_c_locale_timepunct);
49.2685 ++ }
49.2686 +diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
49.2687 +--- gcc-4.3.1.orig/libstdc++-v3/configure 2008-04-25 18:52:57.000000000 +0200
49.2688 ++++ gcc-4.3.1/libstdc++-v3/configure 2008-06-10 14:58:39.000000000 +0200
49.2689 +@@ -14001,7 +14001,7 @@
49.2690 + enableval="$enable_clocale"
49.2691 +
49.2692 + case "$enableval" in
49.2693 +- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
49.2694 ++ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
49.2695 + *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
49.2696 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
49.2697 + { (exit 1); exit 1; }; } ;;
49.2698 +@@ -14034,6 +14034,9 @@
49.2699 + # Default to "generic".
49.2700 + if test $enable_clocale_flag = auto; then
49.2701 + case ${target_os} in
49.2702 ++ linux-uclibc*)
49.2703 ++ enable_clocale_flag=uclibc
49.2704 ++ ;;
49.2705 + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
49.2706 + enable_clocale_flag=gnu
49.2707 + ;;
49.2708 +@@ -14422,6 +14425,76 @@
49.2709 + CTIME_CC=config/locale/generic/time_members.cc
49.2710 + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
49.2711 + ;;
49.2712 ++ uclibc)
49.2713 ++ echo "$as_me:$LINENO: result: uclibc" >&5
49.2714 ++echo "${ECHO_T}uclibc" >&6
49.2715 ++
49.2716 ++ # Declare intention to use gettext, and add support for specific
49.2717 ++ # languages.
49.2718 ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
49.2719 ++ ALL_LINGUAS="de fr"
49.2720 ++
49.2721 ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
49.2722 ++ # Extract the first word of "msgfmt", so it can be a program name with args.
49.2723 ++set dummy msgfmt; ac_word=$2
49.2724 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
49.2725 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
49.2726 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
49.2727 ++ echo $ECHO_N "(cached) $ECHO_C" >&6
49.2728 ++else
49.2729 ++ if test -n "$check_msgfmt"; then
49.2730 ++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
49.2731 ++else
49.2732 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
49.2733 ++for as_dir in $PATH
49.2734 ++do
49.2735 ++ IFS=$as_save_IFS
49.2736 ++ test -z "$as_dir" && as_dir=.
49.2737 ++ for ac_exec_ext in '' $ac_executable_extensions; do
49.2738 ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
49.2739 ++ ac_cv_prog_check_msgfmt="yes"
49.2740 ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
49.2741 ++ break 2
49.2742 ++ fi
49.2743 ++done
49.2744 ++done
49.2745 ++
49.2746 ++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
49.2747 ++fi
49.2748 ++fi
49.2749 ++check_msgfmt=$ac_cv_prog_check_msgfmt
49.2750 ++if test -n "$check_msgfmt"; then
49.2751 ++ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
49.2752 ++echo "${ECHO_T}$check_msgfmt" >&6
49.2753 ++else
49.2754 ++ echo "$as_me:$LINENO: result: no" >&5
49.2755 ++echo "${ECHO_T}no" >&6
49.2756 ++fi
49.2757 ++
49.2758 ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
49.2759 ++ USE_NLS=yes
49.2760 ++ fi
49.2761 ++ # Export the build objects.
49.2762 ++ for ling in $ALL_LINGUAS; do \
49.2763 ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
49.2764 ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
49.2765 ++ done
49.2766 ++
49.2767 ++
49.2768 ++
49.2769 ++ CLOCALE_H=config/locale/uclibc/c_locale.h
49.2770 ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
49.2771 ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
49.2772 ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
49.2773 ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
49.2774 ++ CMESSAGES_H=config/locale/uclibc/messages_members.h
49.2775 ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
49.2776 ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
49.2777 ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
49.2778 ++ CTIME_H=config/locale/uclibc/time_members.h
49.2779 ++ CTIME_CC=config/locale/uclibc/time_members.cc
49.2780 ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
49.2781 ++ ;;
49.2782 + esac
49.2783 +
49.2784 + # This is where the testsuite looks for locale catalogs, using the
49.2785 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h
49.2786 +--- gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 23:59:49.000000000 +0100
49.2787 ++++ gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h 2008-06-10 14:58:39.000000000 +0200
49.2788 +@@ -106,7 +106,9 @@
49.2789 + using std::wmemcpy;
49.2790 + using std::wmemmove;
49.2791 + using std::wmemset;
49.2792 ++#if _GLIBCXX_HAVE_WCSFTIME
49.2793 + using std::wcsftime;
49.2794 ++#endif
49.2795 +
49.2796 + #if _GLIBCXX_USE_C99
49.2797 + using std::wcstold;
50.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
50.2 +++ b/patches/gcc/4.3.1/550-203-uclibc-locale-no__x.patch Tue Jun 10 22:10:40 2008 +0000
50.3 @@ -0,0 +1,224 @@
50.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch
50.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
50.6 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200
50.7 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200
50.8 +@@ -60,4 +60,49 @@
50.9 + extern "C" __typeof(wctype_l) __wctype_l;
50.10 + #endif
50.11 +
50.12 ++# define __nl_langinfo_l nl_langinfo_l
50.13 ++# define __strcoll_l strcoll_l
50.14 ++# define __strftime_l strftime_l
50.15 ++# define __strtod_l strtod_l
50.16 ++# define __strtof_l strtof_l
50.17 ++# define __strtold_l strtold_l
50.18 ++# define __strxfrm_l strxfrm_l
50.19 ++# define __newlocale newlocale
50.20 ++# define __freelocale freelocale
50.21 ++# define __duplocale duplocale
50.22 ++# define __uselocale uselocale
50.23 ++
50.24 ++# ifdef _GLIBCXX_USE_WCHAR_T
50.25 ++# define __iswctype_l iswctype_l
50.26 ++# define __towlower_l towlower_l
50.27 ++# define __towupper_l towupper_l
50.28 ++# define __wcscoll_l wcscoll_l
50.29 ++# define __wcsftime_l wcsftime_l
50.30 ++# define __wcsxfrm_l wcsxfrm_l
50.31 ++# define __wctype_l wctype_l
50.32 ++# endif
50.33 ++
50.34 ++#else
50.35 ++# define __nl_langinfo_l(N, L) nl_langinfo((N))
50.36 ++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
50.37 ++# define __strtod_l(S, E, L) strtod((S), (E))
50.38 ++# define __strtof_l(S, E, L) strtof((S), (E))
50.39 ++# define __strtold_l(S, E, L) strtold((S), (E))
50.40 ++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
50.41 ++# warning should dummy __newlocale check for C|POSIX ?
50.42 ++# define __newlocale(a, b, c) NULL
50.43 ++# define __freelocale(a) ((void)0)
50.44 ++# define __duplocale(a) __c_locale()
50.45 ++//# define __uselocale ?
50.46 ++//
50.47 ++# ifdef _GLIBCXX_USE_WCHAR_T
50.48 ++# define __iswctype_l(C, M, L) iswctype((C), (M))
50.49 ++# define __towlower_l(C, L) towlower((C))
50.50 ++# define __towupper_l(C, L) towupper((C))
50.51 ++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
50.52 ++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
50.53 ++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
50.54 ++# define __wctype_l(S, L) wctype((S))
50.55 ++# endif
50.56 ++
50.57 + #endif // GLIBC 2.3 and later
50.58 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
50.59 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200
50.60 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200
50.61 +@@ -39,20 +39,6 @@
50.62 + #include <langinfo.h>
50.63 + #include <bits/c++locale_internal.h>
50.64 +
50.65 +-#ifndef __UCLIBC_HAS_XLOCALE__
50.66 +-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
50.67 +-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
50.68 +-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
50.69 +-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
50.70 +-#define __strtof_l(S, E, L) strtof((S), (E))
50.71 +-#define __strtod_l(S, E, L) strtod((S), (E))
50.72 +-#define __strtold_l(S, E, L) strtold((S), (E))
50.73 +-#warning should dummy __newlocale check for C|POSIX ?
50.74 +-#define __newlocale(a, b, c) NULL
50.75 +-#define __freelocale(a) ((void)0)
50.76 +-#define __duplocale(a) __c_locale()
50.77 +-#endif
50.78 +-
50.79 + namespace std
50.80 + {
50.81 + template<>
50.82 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
50.83 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200
50.84 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200
50.85 +@@ -68,6 +68,7 @@
50.86 + {
50.87 + extern "C" __typeof(uselocale) __uselocale;
50.88 + }
50.89 ++#define __uselocale uselocale
50.90 + #endif
50.91 +
50.92 + namespace std
50.93 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
50.94 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200
50.95 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200
50.96 +@@ -36,13 +36,6 @@
50.97 + #include <locale>
50.98 + #include <bits/c++locale_internal.h>
50.99 +
50.100 +-#ifndef __UCLIBC_HAS_XLOCALE__
50.101 +-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
50.102 +-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
50.103 +-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
50.104 +-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
50.105 +-#endif
50.106 +-
50.107 + namespace std
50.108 + {
50.109 + // These are basically extensions to char_traits, and perhaps should
50.110 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
50.111 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200
50.112 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200
50.113 +@@ -38,13 +38,6 @@
50.114 + #undef _LIBC
50.115 + #include <bits/c++locale_internal.h>
50.116 +
50.117 +-#ifndef __UCLIBC_HAS_XLOCALE__
50.118 +-#define __wctype_l(S, L) wctype((S))
50.119 +-#define __towupper_l(C, L) towupper((C))
50.120 +-#define __towlower_l(C, L) towlower((C))
50.121 +-#define __iswctype_l(C, M, L) iswctype((C), (M))
50.122 +-#endif
50.123 +-
50.124 + namespace std
50.125 + {
50.126 + // NB: The other ctype<char> specializations are in src/locale.cc and
50.127 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
50.128 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200
50.129 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200
50.130 +@@ -39,13 +39,10 @@
50.131 + #ifdef __UCLIBC_MJN3_ONLY__
50.132 + #warning fix gettext stuff
50.133 + #endif
50.134 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
50.135 +-extern "C" char *__dcgettext(const char *domainname,
50.136 +- const char *msgid, int category);
50.137 + #undef gettext
50.138 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
50.139 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
50.140 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
50.141 + #else
50.142 +-#undef gettext
50.143 + #define gettext(msgid) (msgid)
50.144 + #endif
50.145 +
50.146 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
50.147 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200
50.148 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200
50.149 +@@ -36,15 +36,11 @@
50.150 + #ifdef __UCLIBC_MJN3_ONLY__
50.151 + #warning fix prototypes for *textdomain funcs
50.152 + #endif
50.153 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
50.154 +-extern "C" char *__textdomain(const char *domainname);
50.155 +-extern "C" char *__bindtextdomain(const char *domainname,
50.156 +- const char *dirname);
50.157 +-#else
50.158 +-#undef __textdomain
50.159 +-#undef __bindtextdomain
50.160 +-#define __textdomain(D) ((void)0)
50.161 +-#define __bindtextdomain(D,P) ((void)0)
50.162 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
50.163 ++#undef textdomain
50.164 ++#undef bindtextdomain
50.165 ++#define textdomain(D) ((void)0)
50.166 ++#define bindtextdomain(D,P) ((void)0)
50.167 + #endif
50.168 +
50.169 + // Non-virtual member functions.
50.170 +@@ -70,7 +66,7 @@
50.171 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
50.172 + const char* __dir) const
50.173 + {
50.174 +- __bindtextdomain(__s.c_str(), __dir);
50.175 ++ bindtextdomain(__s.c_str(), __dir);
50.176 + return this->do_open(__s, __loc);
50.177 + }
50.178 +
50.179 +@@ -90,7 +86,7 @@
50.180 + {
50.181 + // No error checking is done, assume the catalog exists and can
50.182 + // be used.
50.183 +- __textdomain(__s.c_str());
50.184 ++ textdomain(__s.c_str());
50.185 + return 0;
50.186 + }
50.187 +
50.188 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
50.189 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200
50.190 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200
50.191 +@@ -43,10 +43,6 @@
50.192 + #warning tailor for stub locale support
50.193 + #endif
50.194 +
50.195 +-#ifndef __UCLIBC_HAS_XLOCALE__
50.196 +-#define __nl_langinfo_l(N, L) nl_langinfo((N))
50.197 +-#endif
50.198 +-
50.199 + namespace std
50.200 + {
50.201 + // Construct and return valid pattern consisting of some combination of:
50.202 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
50.203 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200
50.204 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200
50.205 +@@ -41,9 +41,6 @@
50.206 + #ifdef __UCLIBC_MJN3_ONLY__
50.207 + #warning tailor for stub locale support
50.208 + #endif
50.209 +-#ifndef __UCLIBC_HAS_XLOCALE__
50.210 +-#define __nl_langinfo_l(N, L) nl_langinfo((N))
50.211 +-#endif
50.212 +
50.213 + namespace std
50.214 + {
50.215 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
50.216 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200
50.217 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200
50.218 +@@ -40,9 +40,6 @@
50.219 + #ifdef __UCLIBC_MJN3_ONLY__
50.220 + #warning tailor for stub locale support
50.221 + #endif
50.222 +-#ifndef __UCLIBC_HAS_XLOCALE__
50.223 +-#define __nl_langinfo_l(N, L) nl_langinfo((N))
50.224 +-#endif
50.225 +
50.226 + namespace std
50.227 + {
51.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
51.2 +++ b/patches/gcc/4.3.1/575-204-uclibc-locale-wchar_fix.patch Tue Jun 10 22:10:40 2008 +0000
51.3 @@ -0,0 +1,51 @@
51.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
51.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
51.6 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:47.000000000 +0200
51.7 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:47.000000000 +0200
51.8 +@@ -401,7 +401,7 @@
51.9 + # ifdef __UCLIBC_HAS_XLOCALE__
51.10 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
51.11 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
51.12 +-# else
51.13 ++# elif defined __UCLIBC_HAS_LOCALE__
51.14 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
51.15 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
51.16 + # endif
51.17 +@@ -556,7 +556,7 @@
51.18 + # ifdef __UCLIBC_HAS_XLOCALE__
51.19 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
51.20 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
51.21 +-# else
51.22 ++# elif defined __UCLIBC_HAS_LOCALE__
51.23 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
51.24 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
51.25 + # endif
51.26 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
51.27 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:47.000000000 +0200
51.28 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:47.000000000 +0200
51.29 +@@ -127,12 +127,25 @@
51.30 + {
51.31 + // Named locale.
51.32 + // NB: In the GNU model wchar_t is always 32 bit wide.
51.33 ++#ifdef __UCLIBC_MJN3_ONLY__
51.34 ++#warning fix this... should be numeric
51.35 ++#endif
51.36 ++#ifdef __UCLIBC__
51.37 ++# ifdef __UCLIBC_HAS_XLOCALE__
51.38 ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
51.39 ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
51.40 ++# elif defined __UCLIBC_HAS_LOCALE__
51.41 ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
51.42 ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
51.43 ++# endif
51.44 ++#else
51.45 + union { char *__s; wchar_t __w; } __u;
51.46 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
51.47 + _M_data->_M_decimal_point = __u.__w;
51.48 +
51.49 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
51.50 + _M_data->_M_thousands_sep = __u.__w;
51.51 ++#endif
51.52 +
51.53 + if (_M_data->_M_thousands_sep == L'\0')
51.54 + _M_data->_M_grouping = "";
52.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
52.2 +++ b/patches/gcc/4.3.1/600-205-uclibc-locale-update.patch Tue Jun 10 22:10:40 2008 +0000
52.3 @@ -0,0 +1,355 @@
52.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_205-uclibc-locale-update.patch
52.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
52.6 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:47.000000000 +0200
52.7 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:51.000000000 +0200
52.8 +@@ -46,16 +46,13 @@
52.9 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
52.10 + const __c_locale& __cloc)
52.11 + {
52.12 +- if (!(__err & ios_base::failbit))
52.13 +- {
52.14 +- char* __sanity;
52.15 +- errno = 0;
52.16 +- float __f = __strtof_l(__s, &__sanity, __cloc);
52.17 +- if (__sanity != __s && errno != ERANGE)
52.18 +- __v = __f;
52.19 +- else
52.20 +- __err |= ios_base::failbit;
52.21 +- }
52.22 ++ char* __sanity;
52.23 ++ errno = 0;
52.24 ++ float __f = __strtof_l(__s, &__sanity, __cloc);
52.25 ++ if (__sanity != __s && errno != ERANGE)
52.26 ++ __v = __f;
52.27 ++ else
52.28 ++ __err |= ios_base::failbit;
52.29 + }
52.30 +
52.31 + template<>
52.32 +@@ -63,16 +60,13 @@
52.33 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
52.34 + const __c_locale& __cloc)
52.35 + {
52.36 +- if (!(__err & ios_base::failbit))
52.37 +- {
52.38 +- char* __sanity;
52.39 +- errno = 0;
52.40 +- double __d = __strtod_l(__s, &__sanity, __cloc);
52.41 +- if (__sanity != __s && errno != ERANGE)
52.42 +- __v = __d;
52.43 +- else
52.44 +- __err |= ios_base::failbit;
52.45 +- }
52.46 ++ char* __sanity;
52.47 ++ errno = 0;
52.48 ++ double __d = __strtod_l(__s, &__sanity, __cloc);
52.49 ++ if (__sanity != __s && errno != ERANGE)
52.50 ++ __v = __d;
52.51 ++ else
52.52 ++ __err |= ios_base::failbit;
52.53 + }
52.54 +
52.55 + template<>
52.56 +@@ -80,16 +74,13 @@
52.57 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
52.58 + const __c_locale& __cloc)
52.59 + {
52.60 +- if (!(__err & ios_base::failbit))
52.61 +- {
52.62 +- char* __sanity;
52.63 +- errno = 0;
52.64 +- long double __ld = __strtold_l(__s, &__sanity, __cloc);
52.65 +- if (__sanity != __s && errno != ERANGE)
52.66 +- __v = __ld;
52.67 +- else
52.68 +- __err |= ios_base::failbit;
52.69 +- }
52.70 ++ char* __sanity;
52.71 ++ errno = 0;
52.72 ++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
52.73 ++ if (__sanity != __s && errno != ERANGE)
52.74 ++ __v = __ld;
52.75 ++ else
52.76 ++ __err |= ios_base::failbit;
52.77 + }
52.78 +
52.79 + void
52.80 +@@ -110,7 +101,7 @@
52.81 + void
52.82 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
52.83 + {
52.84 +- if (_S_get_c_locale() != __cloc)
52.85 ++ if (__cloc && _S_get_c_locale() != __cloc)
52.86 + __freelocale(__cloc);
52.87 + }
52.88 +
52.89 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
52.90 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:47.000000000 +0200
52.91 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:51.000000000 +0200
52.92 +@@ -39,21 +39,23 @@
52.93 + #pragma GCC system_header
52.94 +
52.95 + #include <cstring> // get std::strlen
52.96 +-#include <cstdio> // get std::snprintf or std::sprintf
52.97 ++#include <cstdio> // get std::vsnprintf or std::vsprintf
52.98 + #include <clocale>
52.99 + #include <langinfo.h> // For codecvt
52.100 + #ifdef __UCLIBC_MJN3_ONLY__
52.101 + #warning fix this
52.102 + #endif
52.103 +-#ifdef __UCLIBC_HAS_LOCALE__
52.104 ++#ifdef _GLIBCXX_USE_ICONV
52.105 + #include <iconv.h> // For codecvt using iconv, iconv_t
52.106 + #endif
52.107 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
52.108 +-#include <libintl.h> // For messages
52.109 ++#ifdef HAVE_LIBINTL_H
52.110 ++#include <libintl.h> // For messages
52.111 + #endif
52.112 ++#include <cstdarg>
52.113 +
52.114 + #ifdef __UCLIBC_MJN3_ONLY__
52.115 + #warning what is _GLIBCXX_C_LOCALE_GNU for
52.116 ++// psm: used in os/gnu-linux/ctype_noninline.h
52.117 + #endif
52.118 + #define _GLIBCXX_C_LOCALE_GNU 1
52.119 +
52.120 +@@ -62,7 +64,7 @@
52.121 + #endif
52.122 + // #define _GLIBCXX_NUM_CATEGORIES 6
52.123 + #define _GLIBCXX_NUM_CATEGORIES 0
52.124 +-
52.125 ++
52.126 + #ifdef __UCLIBC_HAS_XLOCALE__
52.127 + namespace __gnu_cxx
52.128 + {
52.129 +@@ -79,22 +81,24 @@
52.130 + typedef int* __c_locale;
52.131 + #endif
52.132 +
52.133 +- // Convert numeric value of type _Tv to string and return length of
52.134 +- // string. If snprintf is available use it, otherwise fall back to
52.135 +- // the unsafe sprintf which, in general, can be dangerous and should
52.136 ++ // Convert numeric value of type double to string and return length of
52.137 ++ // string. If vsnprintf is available use it, otherwise fall back to
52.138 ++ // the unsafe vsprintf which, in general, can be dangerous and should
52.139 + // be avoided.
52.140 +- template<typename _Tv>
52.141 +- int
52.142 +- __convert_from_v(char* __out,
52.143 +- const int __size __attribute__ ((__unused__)),
52.144 +- const char* __fmt,
52.145 +-#ifdef __UCLIBC_HAS_XCLOCALE__
52.146 +- _Tv __v, const __c_locale& __cloc, int __prec)
52.147 ++ inline int
52.148 ++ __convert_from_v(const __c_locale&
52.149 ++#ifndef __UCLIBC_HAS_XCLOCALE__
52.150 ++ __cloc __attribute__ ((__unused__))
52.151 ++#endif
52.152 ++ ,
52.153 ++ char* __out,
52.154 ++ const int __size,
52.155 ++ const char* __fmt, ...)
52.156 + {
52.157 ++ va_list __args;
52.158 ++#ifdef __UCLIBC_HAS_XCLOCALE__
52.159 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
52.160 + #else
52.161 +- _Tv __v, const __c_locale&, int __prec)
52.162 +- {
52.163 + # ifdef __UCLIBC_HAS_LOCALE__
52.164 + char* __old = std::setlocale(LC_ALL, NULL);
52.165 + char* __sav = new char[std::strlen(__old) + 1];
52.166 +@@ -103,7 +107,9 @@
52.167 + # endif
52.168 + #endif
52.169 +
52.170 +- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
52.171 ++ va_start(__args, __fmt);
52.172 ++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
52.173 ++ va_end(__args);
52.174 +
52.175 + #ifdef __UCLIBC_HAS_XCLOCALE__
52.176 + __gnu_cxx::__uselocale(__old);
52.177 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
52.178 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:47.000000000 +0200
52.179 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:51.000000000 +0200
52.180 +@@ -33,9 +33,14 @@
52.181 +
52.182 + // Written by Benjamin Kosnik <bkoz@redhat.com>
52.183 +
52.184 ++#include <features.h>
52.185 ++#ifdef __UCLIBC_HAS_LOCALE__
52.186 + #define _LIBC
52.187 + #include <locale>
52.188 + #undef _LIBC
52.189 ++#else
52.190 ++#include <locale>
52.191 ++#endif
52.192 + #include <bits/c++locale_internal.h>
52.193 +
52.194 + namespace std
52.195 +@@ -138,20 +143,34 @@
52.196 + ctype<wchar_t>::
52.197 + do_is(mask __m, wchar_t __c) const
52.198 + {
52.199 +- // Highest bitmask in ctype_base == 10, but extra in "C"
52.200 +- // library for blank.
52.201 ++ // The case of __m == ctype_base::space is particularly important,
52.202 ++ // due to its use in many istream functions. Therefore we deal with
52.203 ++ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
52.204 ++ // is the mask corresponding to ctype_base::space. NB: an encoding
52.205 ++ // change would not affect correctness!
52.206 + bool __ret = false;
52.207 +- const size_t __bitmasksize = 11;
52.208 +- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
52.209 +- if (__m & _M_bit[__bitcur]
52.210 +- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
52.211 +- {
52.212 +- __ret = true;
52.213 +- break;
52.214 +- }
52.215 ++ if (__m == _M_bit[5])
52.216 ++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
52.217 ++ else
52.218 ++ {
52.219 ++ // Highest bitmask in ctype_base == 10, but extra in "C"
52.220 ++ // library for blank.
52.221 ++ const size_t __bitmasksize = 11;
52.222 ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
52.223 ++ if (__m & _M_bit[__bitcur])
52.224 ++ {
52.225 ++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
52.226 ++ {
52.227 ++ __ret = true;
52.228 ++ break;
52.229 ++ }
52.230 ++ else if (__m == _M_bit[__bitcur])
52.231 ++ break;
52.232 ++ }
52.233 ++ }
52.234 + return __ret;
52.235 + }
52.236 +-
52.237 ++
52.238 + const wchar_t*
52.239 + ctype<wchar_t>::
52.240 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
52.241 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
52.242 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:47.000000000 +0200
52.243 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:51.000000000 +0200
52.244 +@@ -47,18 +47,21 @@
52.245 + template<typename _CharT>
52.246 + messages<_CharT>::messages(size_t __refs)
52.247 + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
52.248 +- _M_name_messages(_S_get_c_name())
52.249 ++ _M_name_messages(_S_get_c_name())
52.250 + { }
52.251 +
52.252 + template<typename _CharT>
52.253 + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
52.254 + size_t __refs)
52.255 +- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
52.256 +- _M_name_messages(__s)
52.257 ++ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
52.258 + {
52.259 +- char* __tmp = new char[std::strlen(__s) + 1];
52.260 +- std::strcpy(__tmp, __s);
52.261 ++ const size_t __len = std::strlen(__s) + 1;
52.262 ++ char* __tmp = new char[__len];
52.263 ++ std::memcpy(__tmp, __s, __len);
52.264 + _M_name_messages = __tmp;
52.265 ++
52.266 ++ // Last to avoid leaking memory if new throws.
52.267 ++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
52.268 + }
52.269 +
52.270 + template<typename _CharT>
52.271 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
52.272 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:51.000000000 +0200
52.273 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:51.000000000 +0200
52.274 +@@ -33,9 +33,14 @@
52.275 +
52.276 + // Written by Benjamin Kosnik <bkoz@redhat.com>
52.277 +
52.278 ++#include <features.h>
52.279 ++#ifdef __UCLIBC_HAS_LOCALE__
52.280 + #define _LIBC
52.281 + #include <locale>
52.282 + #undef _LIBC
52.283 ++#else
52.284 ++#include <locale>
52.285 ++#endif
52.286 + #include <bits/c++locale_internal.h>
52.287 +
52.288 + #ifdef __UCLIBC_MJN3_ONLY__
52.289 +@@ -206,7 +211,7 @@
52.290 + }
52.291 + break;
52.292 + default:
52.293 +- ;
52.294 ++ __ret = pattern();
52.295 + }
52.296 + return __ret;
52.297 + }
52.298 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
52.299 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:51.000000000 +0200
52.300 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:51.000000000 +0200
52.301 +@@ -33,9 +33,14 @@
52.302 +
52.303 + // Written by Benjamin Kosnik <bkoz@redhat.com>
52.304 +
52.305 ++#include <features.h>
52.306 ++#ifdef __UCLIBC_HAS_LOCALE__
52.307 + #define _LIBC
52.308 + #include <locale>
52.309 + #undef _LIBC
52.310 ++#else
52.311 ++#include <locale>
52.312 ++#endif
52.313 + #include <bits/c++locale_internal.h>
52.314 +
52.315 + #ifdef __UCLIBC_MJN3_ONLY__
52.316 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
52.317 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:43.000000000 +0200
52.318 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:51.000000000 +0200
52.319 +@@ -37,25 +37,33 @@
52.320 + template<typename _CharT>
52.321 + __timepunct<_CharT>::__timepunct(size_t __refs)
52.322 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
52.323 +- _M_name_timepunct(_S_get_c_name())
52.324 ++ _M_name_timepunct(_S_get_c_name())
52.325 + { _M_initialize_timepunct(); }
52.326 +
52.327 + template<typename _CharT>
52.328 + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
52.329 + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
52.330 +- _M_name_timepunct(_S_get_c_name())
52.331 ++ _M_name_timepunct(_S_get_c_name())
52.332 + { _M_initialize_timepunct(); }
52.333 +
52.334 + template<typename _CharT>
52.335 + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
52.336 + size_t __refs)
52.337 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
52.338 +- _M_name_timepunct(__s)
52.339 ++ _M_name_timepunct(NULL)
52.340 + {
52.341 +- char* __tmp = new char[std::strlen(__s) + 1];
52.342 +- std::strcpy(__tmp, __s);
52.343 ++ const size_t __len = std::strlen(__s) + 1;
52.344 ++ char* __tmp = new char[__len];
52.345 ++ std::memcpy(__tmp, __s, __len);
52.346 + _M_name_timepunct = __tmp;
52.347 +- _M_initialize_timepunct(__cloc);
52.348 ++
52.349 ++ try
52.350 ++ { _M_initialize_timepunct(__cloc); }
52.351 ++ catch(...)
52.352 ++ {
52.353 ++ delete [] _M_name_timepunct;
52.354 ++ __throw_exception_again;
52.355 ++ }
52.356 + }
52.357 +
52.358 + template<typename _CharT>
53.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
53.2 +++ b/patches/gcc/4.3.1/625-301-missing-execinfo_h.patch Tue Jun 10 22:10:40 2008 +0000
53.3 @@ -0,0 +1,13 @@
53.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch
53.5 +diff -durN gcc-4.3.1.orig/boehm-gc/include/gc.h gcc-4.3.1/boehm-gc/include/gc.h
53.6 +--- gcc-4.3.1.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
53.7 ++++ gcc-4.3.1/boehm-gc/include/gc.h 2008-06-10 14:58:54.000000000 +0200
53.8 +@@ -503,7 +503,7 @@
53.9 + #if defined(__linux__) || defined(__GLIBC__)
53.10 + # include <features.h>
53.11 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
53.12 +- && !defined(__ia64__)
53.13 ++ && !defined(__ia64__) && !defined(__UCLIBC__)
53.14 + # ifndef GC_HAVE_BUILTIN_BACKTRACE
53.15 + # define GC_HAVE_BUILTIN_BACKTRACE
53.16 + # endif
54.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
54.2 +++ b/patches/gcc/4.3.1/650-303-c99-complex-ugly-hack.patch Tue Jun 10 22:10:40 2008 +0000
54.3 @@ -0,0 +1,14 @@
54.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch
54.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
54.6 +--- gcc-4.3.1.orig/libstdc++-v3/configure 2008-06-10 14:58:43.000000000 +0200
54.7 ++++ gcc-4.3.1/libstdc++-v3/configure 2008-06-10 14:58:58.000000000 +0200
54.8 +@@ -39006,6 +39006,9 @@
54.9 + cat >>conftest.$ac_ext <<_ACEOF
54.10 + /* end confdefs.h. */
54.11 + #include <complex.h>
54.12 ++#ifdef __UCLIBC__
54.13 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
54.14 ++#endif
54.15 + int
54.16 + main ()
54.17 + {
55.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
55.2 +++ b/patches/gcc/4.3.1/675-304-index_macro.patch Tue Jun 10 22:10:40 2008 +0000
55.3 @@ -0,0 +1,27 @@
55.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
55.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/rope gcc-4.3.1/libstdc++-v3/include/ext/rope
55.6 +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100
55.7 ++++ gcc-4.3.1/libstdc++-v3/include/ext/rope 2008-06-10 14:59:02.000000000 +0200
55.8 +@@ -59,6 +59,9 @@
55.9 + #include <bits/gthr.h>
55.10 + #include <tr1/functional>
55.11 +
55.12 ++/* cope w/ index defined as macro, SuSv3 proposal */
55.13 ++#undef index
55.14 ++
55.15 + # ifdef __GC
55.16 + # define __GC_CONST const
55.17 + # else
55.18 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h
55.19 +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200
55.20 ++++ gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:59:02.000000000 +0200
55.21 +@@ -54,6 +54,9 @@
55.22 + #include <ext/memory> // For uninitialized_copy_n
55.23 + #include <ext/numeric> // For power
55.24 +
55.25 ++/* cope w/ index defined as macro, SuSv3 proposal */
55.26 ++#undef index
55.27 ++
55.28 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
55.29 +
55.30 + using std::size_t;
56.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
56.2 +++ b/patches/gcc/4.3.1/700-305-libmudflap-susv3-legacy.patch Tue Jun 10 22:10:40 2008 +0000
56.3 @@ -0,0 +1,49 @@
56.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
56.5 +diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c
56.6 +--- gcc-4.3.1.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
56.7 ++++ gcc-4.3.1/libmudflap/mf-hooks2.c 2008-06-10 14:59:05.000000000 +0200
56.8 +@@ -427,7 +427,7 @@
56.9 + {
56.10 + TRACE ("%s\n", __PRETTY_FUNCTION__);
56.11 + MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
56.12 +- bzero (s, n);
56.13 ++ memset (s, 0, n);
56.14 + }
56.15 +
56.16 +
56.17 +@@ -437,7 +437,7 @@
56.18 + TRACE ("%s\n", __PRETTY_FUNCTION__);
56.19 + MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
56.20 + MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
56.21 +- bcopy (src, dest, n);
56.22 ++ memmove (dest, src, n);
56.23 + }
56.24 +
56.25 +
56.26 +@@ -447,7 +447,7 @@
56.27 + TRACE ("%s\n", __PRETTY_FUNCTION__);
56.28 + MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
56.29 + MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
56.30 +- return bcmp (s1, s2, n);
56.31 ++ return memcmp (s1, s2, n);
56.32 + }
56.33 +
56.34 +
56.35 +@@ -456,7 +456,7 @@
56.36 + size_t n = strlen (s);
56.37 + TRACE ("%s\n", __PRETTY_FUNCTION__);
56.38 + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
56.39 +- return index (s, c);
56.40 ++ return strchr (s, c);
56.41 + }
56.42 +
56.43 +
56.44 +@@ -465,7 +465,7 @@
56.45 + size_t n = strlen (s);
56.46 + TRACE ("%s\n", __PRETTY_FUNCTION__);
56.47 + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
56.48 +- return rindex (s, c);
56.49 ++ return strrchr (s, c);
56.50 + }
56.51 +
56.52 + /* XXX: stpcpy, memccpy */
57.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
57.2 +++ b/patches/gcc/4.3.1/725-306-libstdc++-namespace.patch Tue Jun 10 22:10:40 2008 +0000
57.3 @@ -0,0 +1,38 @@
57.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_306-libstdc++-namespace.patch
57.5 +diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
57.6 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
57.7 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:54.000000000 +0200
57.8 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:59:09.000000000 +0200
57.9 +@@ -32,7 +32,8 @@
57.10 + //
57.11 +
57.12 + // Written by Benjamin Kosnik <bkoz@redhat.com>
57.13 +-
57.14 ++namespace std
57.15 ++{
57.16 + #ifdef __UCLIBC_MJN3_ONLY__
57.17 + #warning fix prototypes for *textdomain funcs
57.18 + #endif
57.19 +@@ -115,3 +116,4 @@
57.20 + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
57.21 + }
57.22 + }
57.23 ++}
57.24 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
57.25 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:54.000000000 +0200
57.26 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:59:09.000000000 +0200
57.27 +@@ -33,7 +33,8 @@
57.28 + //
57.29 +
57.30 + // Written by Benjamin Kosnik <bkoz@redhat.com>
57.31 +-
57.32 ++namespace std
57.33 ++{
57.34 + template<typename _CharT>
57.35 + __timepunct<_CharT>::__timepunct(size_t __refs)
57.36 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
57.37 +@@ -74,3 +75,4 @@
57.38 + delete _M_data;
57.39 + _S_destroy_c_locale(_M_c_locale_timepunct);
57.40 + }
57.41 ++}