Commit c8061de7 by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/44417 (make check-target-libstdc++-v3 fails due to undefined ptrdiff_t)

2010-06-07  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/44417
	* include/c_std/cwctype: Provide a workaround for bug glibc
	BZ 9694 affecting glibc 2.9 and older.
	* include/c_global/cwctype: Likewise.
	* testsuite/util/testsuite_abi.h: Remove temporary workaround.
	* testsuite/util/testsuite_allocator.h: Use everywhere std::size_t
	and std::ptrdiff_t, don't include <cstddef>.

	* testsuite/27_io/basic_ostream/inserters_other/wchar_t/
	error_code.cc: Minor tweak, prefer <cwchar> to <wchar.h>.

From-SVN: r160417
parent 567d4027
2010-06-07 Paolo Carlini <paolo.carlini@oracle.com> 2010-06-07 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44417
* include/c_std/cwctype: Provide a workaround for bug glibc
BZ 9694 affecting glibc 2.9 and older.
* include/c_global/cwctype: Likewise.
* testsuite/util/testsuite_abi.h: Remove temporary workaround.
* testsuite/util/testsuite_allocator.h: Use everywhere std::size_t
and std::ptrdiff_t, don't include <cstddef>.
* testsuite/27_io/basic_ostream/inserters_other/wchar_t/
error_code.cc: Minor tweak, prefer <cwchar> to <wchar.h>.
2010-06-07 Paolo Carlini <paolo.carlini@oracle.com>
* include/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp: * include/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp:
Avoid -Wall warnings. Avoid -Wall warnings.
* testsuite/27_io/ios_base/failure/what-3.cc: Likewise. * testsuite/27_io/ios_base/failure/what-3.cc: Likewise.
......
...@@ -43,9 +43,15 @@ ...@@ -43,9 +43,15 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#if _GLIBCXX_HAVE_WCTYPE_H #if _GLIBCXX_HAVE_WCTYPE_H
#include <wctype.h>
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 10
// Work around glibc BZ 9694
#include <stddef.h>
#endif #endif
#include <wctype.h>
#endif // _GLIBCXX_HAVE_WCTYPE_H
#ifndef _GLIBCXX_CWCTYPE #ifndef _GLIBCXX_CWCTYPE
#define _GLIBCXX_CWCTYPE 1 #define _GLIBCXX_CWCTYPE 1
......
...@@ -45,9 +45,15 @@ ...@@ -45,9 +45,15 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#if _GLIBCXX_HAVE_WCTYPE_H #if _GLIBCXX_HAVE_WCTYPE_H
#include <wctype.h>
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 10
// Work around glibc BZ 9694
#include <stddef.h>
#endif #endif
#include <wctype.h>
#endif // _GLIBCXX_HAVE_WCTYPE_H
// Get rid of those macros defined in <wctype.h> in lieu of real functions. // Get rid of those macros defined in <wctype.h> in lieu of real functions.
#undef iswalnum #undef iswalnum
#undef iswalpha #undef iswalpha
......
// { dg-options "-std=gnu++0x" } // { dg-options "-std=gnu++0x" }
// { dg-require-swprintf "" } // { dg-require-swprintf "" }
// Copyright (C) 2007, 2008, 2009 Free Software Foundation // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <sstream> #include <sstream>
#include <system_error> #include <system_error>
#include <algorithm> #include <algorithm>
#include <wchar.h> #include <cwchar>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
// Effects: os << ec.category().name() << ':' << ec.value(); // Effects: os << ec.category().name() << ':' << ec.value();
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
// Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as // modify it under the terms of the GNU General Public License as
...@@ -16,11 +17,8 @@ ...@@ -16,11 +17,8 @@
// along with this library; see the file COPYING3. If not see // along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// Benjamin Kosnik <bkoz@redhat.com> // Benjamin Kosnik <bkoz@redhat.com>
// Include stddef now to work around glibc BZ 9694
#include <stddef.h>
#include <string> #include <string>
#include <stdexcept> #include <stdexcept>
#include <vector> #include <vector>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#ifndef _GLIBCXX_TESTSUITE_ALLOCATOR_H #ifndef _GLIBCXX_TESTSUITE_ALLOCATOR_H
#define _GLIBCXX_TESTSUITE_ALLOCATOR_H #define _GLIBCXX_TESTSUITE_ALLOCATOR_H
#include <cstddef>
#include <tr1/unordered_map> #include <tr1/unordered_map>
#include <cassert> #include <cassert>
#include <bits/move.h> #include <bits/move.h>
...@@ -241,8 +240,8 @@ namespace __gnu_test ...@@ -241,8 +240,8 @@ namespace __gnu_test
: private uneq_allocator_base : private uneq_allocator_base
{ {
public: public:
typedef size_t size_type; typedef std::size_t size_type;
typedef ptrdiff_t difference_type; typedef std::ptrdiff_t difference_type;
typedef Tp* pointer; typedef Tp* pointer;
typedef const Tp* const_pointer; typedef const Tp* const_pointer;
typedef Tp& reference; typedef Tp& reference;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment