From: paolo Date: Sun, 18 Feb 2007 11:32:44 +0000 (+0000) Subject: 2007-02-18 Paolo Carlini X-Git-Tag: upstream/4.9.2~50315 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b83f6bcee38c542f71166cef17dc4d1551bc04f0;p=platform%2Fupstream%2Flinaro-gcc.git 2007-02-18 Paolo Carlini PR libstdc++/28080 (partial) * include/bits/stl_algobase.h: Do not include , use std::numeric_limits. * include/bits/stl_bvector.h: Use __CHAR_BIT__. * config/locale/gnu/codecvt_members.cc: Include . * config/locale/generic/codecvt_members.cc: Likewise. * include/std/string: Do not include ; do not include , include instead. * include/ext/vstring_fwd.h: Likewise. * include/ext/vstring_util.h: Do not include . * include/tr1/hashtable_policy.h: Include . * testsuite/21_strings/basic_string/replace/char/1.cc: Likewise. * testsuite/21_strings/basic_string/replace/wchar_t/1.cc: Likewise. * testsuite/23_containers/bitset/cons/1.cc: Likewise. * testsuite/util/testsuite_character.h: Likewise. * config/locale/gnu/codecvt_members.cc: Also include , for MB_CUR_MAX. * config/locale/generic/codecvt_members.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122089 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7544dd3..eb1a05b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,25 @@ +2007-02-18 Paolo Carlini + + PR libstdc++/28080 (partial) + * include/bits/stl_algobase.h: Do not include , use + std::numeric_limits. + * include/bits/stl_bvector.h: Use __CHAR_BIT__. + * config/locale/gnu/codecvt_members.cc: Include . + * config/locale/generic/codecvt_members.cc: Likewise. + * include/std/string: Do not include ; do not include + , include instead. + * include/ext/vstring_fwd.h: Likewise. + * include/ext/vstring_util.h: Do not include . + * include/tr1/hashtable_policy.h: Include . + * testsuite/21_strings/basic_string/replace/char/1.cc: Likewise. + * testsuite/21_strings/basic_string/replace/wchar_t/1.cc: Likewise. + * testsuite/23_containers/bitset/cons/1.cc: Likewise. + * testsuite/util/testsuite_character.h: Likewise. + + * config/locale/gnu/codecvt_members.cc: Also include , + for MB_CUR_MAX. + * config/locale/generic/codecvt_members.cc: Likewise. + 2007-02-16 Paolo Carlini Revert. diff --git a/libstdc++-v3/config/locale/generic/codecvt_members.cc b/libstdc++-v3/config/locale/generic/codecvt_members.cc index 555c3b3..7b03b5b 100644 --- a/libstdc++-v3/config/locale/generic/codecvt_members.cc +++ b/libstdc++-v3/config/locale/generic/codecvt_members.cc @@ -1,6 +1,7 @@ // std::codecvt implementation details, generic version -*- C++ -*- -// Copyright (C) 2002, 2005 Free Software Foundation, Inc. +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -34,6 +35,8 @@ // Written by Benjamin Kosnik #include +#include // For MB_CUR_MAX +#include // For MB_LEN_MAX _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/config/locale/gnu/codecvt_members.cc b/libstdc++-v3/config/locale/gnu/codecvt_members.cc index ac1fe92..949927d 100644 --- a/libstdc++-v3/config/locale/gnu/codecvt_members.cc +++ b/libstdc++-v3/config/locale/gnu/codecvt_members.cc @@ -1,6 +1,7 @@ // std::codecvt implementation details, GNU version -*- C++ -*- -// Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -34,6 +35,8 @@ // Written by Benjamin Kosnik #include +#include // For MB_CUR_MAX +#include // For MB_LEN_MAX #include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index c24a4f8..35a8a038 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -65,13 +65,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include #include #include #include @@ -318,8 +318,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // Helpers for streambuf iterators (either istream or ostream). template - typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, - ostreambuf_iterator<_CharT> >::__type + typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, + ostreambuf_iterator<_CharT> >::__type __copy_aux(_CharT*, _CharT*, ostreambuf_iterator<_CharT>); template @@ -328,7 +328,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) __copy_aux(const _CharT*, const _CharT*, ostreambuf_iterator<_CharT>); template - typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, _CharT*>::__type + typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, + _CharT*>::__type __copy_aux(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, _CharT*); @@ -979,17 +980,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); -#if CHAR_MAX == SCHAR_MAX - return std::lexicographical_compare((const signed char*) __first1, - (const signed char*) __last1, - (const signed char*) __first2, - (const signed char*) __last2); -#else /* CHAR_MAX == SCHAR_MAX */ - return std::lexicographical_compare((const unsigned char*) __first1, - (const unsigned char*) __last1, - (const unsigned char*) __first2, - (const unsigned char*) __last2); -#endif /* CHAR_MAX == SCHAR_MAX */ + if (std::numeric_limits::is_signed) + return std::lexicographical_compare((const signed char*) __first1, + (const signed char*) __last1, + (const signed char*) __first2, + (const signed char*) __last2); + else + return std::lexicographical_compare((const unsigned char*) __first1, + (const unsigned char*) __last1, + (const unsigned char*) __first2, + (const unsigned char*) __last2); } _GLIBCXX_END_NAMESPACE diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index 9dc2656..de72dac 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -1,6 +1,6 @@ // vector specialization -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -65,7 +65,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) typedef unsigned long _Bit_type; - enum { _S_word_bit = int(CHAR_BIT * sizeof(_Bit_type)) }; + enum { _S_word_bit = int(__CHAR_BIT__ * sizeof(_Bit_type)) }; struct _Bit_reference { diff --git a/libstdc++-v3/include/ext/vstring_fwd.h b/libstdc++-v3/include/ext/vstring_fwd.h index 9537006..bc11d60 100644 --- a/libstdc++-v3/include/ext/vstring_fwd.h +++ b/libstdc++-v3/include/ext/vstring_fwd.h @@ -1,6 +1,6 @@ // Versatile string forward -*- C++ -*- -// Copyright (C) 2005 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -40,7 +40,7 @@ #include #include -#include // For allocator. +#include _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) diff --git a/libstdc++-v3/include/ext/vstring_util.h b/libstdc++-v3/include/ext/vstring_util.h index e29d8bf..fee06e3 100644 --- a/libstdc++-v3/include/ext/vstring_util.h +++ b/libstdc++-v3/include/ext/vstring_util.h @@ -43,7 +43,6 @@ #include // For less #include #include -#include // For std::distance, srd::search. _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) diff --git a/libstdc++-v3/include/std/string b/libstdc++-v3/include/std/string index c38d525..0899cfe 100644 --- a/libstdc++-v3/include/std/string +++ b/libstdc++-v3/include/std/string @@ -1,6 +1,7 @@ // Components for manipulating sequences of characters -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +// 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -43,8 +44,8 @@ #include #include -#include -#include // For allocator. +#include // NB: In turn includes stl_algobase.h +#include #include #include // For operators >>, <<, and getline decls. #include @@ -52,7 +53,6 @@ #include #ifndef _GLIBCXX_EXPORT_TEMPLATE -# include // for find_if # include #endif diff --git a/libstdc++-v3/include/tr1/hashtable_policy.h b/libstdc++-v3/include/tr1/hashtable_policy.h index 2d3830d..568d2ff 100644 --- a/libstdc++-v3/include/tr1/hashtable_policy.h +++ b/libstdc++-v3/include/tr1/hashtable_policy.h @@ -1,6 +1,6 @@ // Internal policy header for TR1 unordered_set and unordered_map -*- C++ -*- -// Copyright (C) 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -35,6 +35,7 @@ #define _TR1_HASHTABLE_POLICY_H 1 #include // _Identity, _Select1st +#include // lower_bound #include #include diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc index 87cc9f7..d8630ac 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc @@ -1,6 +1,7 @@ // 1999-06-10 bkoz -// Copyright (C) 1994, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. +// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +// 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -21,6 +22,7 @@ // 21.3.5.6 basic_string::replace #include +#include // for std::find #include bool test01(void) diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc index c4592fc..d98c578 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc @@ -1,6 +1,7 @@ // 1999-06-10 bkoz -// Copyright (C) 1994, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. +// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +// 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -21,6 +22,7 @@ // 21.3.5.6 basic_string::replace #include +#include // for std::find #include bool test01(void) diff --git a/libstdc++-v3/testsuite/23_containers/bitset/cons/1.cc b/libstdc++-v3/testsuite/23_containers/bitset/cons/1.cc index 6800763..79aea91 100644 --- a/libstdc++-v3/testsuite/23_containers/bitset/cons/1.cc +++ b/libstdc++-v3/testsuite/23_containers/bitset/cons/1.cc @@ -1,6 +1,7 @@ // 1999-06-08 bkoz -// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc. +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -22,6 +23,7 @@ #include #include +#include // std::reverse #include #include diff --git a/libstdc++-v3/testsuite/util/testsuite_character.h b/libstdc++-v3/testsuite/util/testsuite_character.h index a9e4847..547775b 100644 --- a/libstdc++-v3/testsuite/util/testsuite_character.h +++ b/libstdc++-v3/testsuite/util/testsuite_character.h @@ -3,7 +3,7 @@ // Testing character type and state type with char_traits and codecvt // specializations for the C++ library testsuite. // -// Copyright (C) 2003, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -36,6 +36,7 @@ #include #include // for char_traits #include // for codecvt +#include // for transform #include namespace __gnu_test