Commit 1769232d by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/28080 (header dependencies)

2007-03-02  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/thread/pthread1.cc: Include <pthread.h>.
	* testsuite/thread/pthread2.cc: Likewise.
	* testsuite/thread/pthread3.cc: Likewise.
	* testsuite/thread/pthread4.cc: Likewise.
	* testsuite/thread/pthread5.cc: Likewise.
	* testsuite/thread/pthread6.cc: Likewise.
	* testsuite/thread/pthread7-rope.cc: Likewise.

2007-03-02  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/28080 (partial)
	* include/tr1/random (class random_device): Rework to use simple
	<cstdio> input, do not include <fstream>.
	* include/tr1/random.tcc (all inserters and extractors): Refer
	to ios_base as base class of basic_istream or basic_ostream.

From-SVN: r122478
parent 7393f7f8
2007-03-02 Paolo Carlini <pcarlini@suse.de>
* testsuite/thread/pthread1.cc: Include <pthread.h>.
* testsuite/thread/pthread2.cc: Likewise.
* testsuite/thread/pthread3.cc: Likewise.
* testsuite/thread/pthread4.cc: Likewise.
* testsuite/thread/pthread5.cc: Likewise.
* testsuite/thread/pthread6.cc: Likewise.
* testsuite/thread/pthread7-rope.cc: Likewise.
2007-03-02 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/28080 (partial)
* include/tr1/random (class random_device): Rework to use simple
<cstdio> input, do not include <fstream>.
* include/tr1/random.tcc (all inserters and extractors): Refer
to ios_base as base class of basic_istream or basic_ostream.
2007-03-01 Brooks Moses <brooks.moses@codesourcery.com> 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
* Makefile.am: Add dummy install-pdf target. * Makefile.am: Add dummy install-pdf target.
......
...@@ -35,17 +35,16 @@ ...@@ -35,17 +35,16 @@
#ifndef _TR1_RANDOM #ifndef _TR1_RANDOM
#define _TR1_RANDOM 1 #define _TR1_RANDOM 1
#include <bits/stl_algobase.h>
#include <bits/concept_check.h>
#include <cmath> #include <cmath>
#include <debug/debug.h> #include <cstdio>
#include <iterator> #include <string>
#include <iosfwd> #include <iosfwd>
#include <limits> #include <limits>
#include <tr1/type_traits> #include <tr1/type_traits>
#include <tr1/cmath> #include <tr1/cmath>
#include <fstream>
#include <ext/type_traits.h> #include <ext/type_traits.h>
#include <bits/concept_check.h>
#include <debug/debug.h>
namespace std namespace std
{ {
...@@ -1421,14 +1420,13 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) ...@@ -1421,14 +1420,13 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
random_device(const std::string& __token = "/dev/urandom") random_device(const std::string& __token = "/dev/urandom")
{ {
if ((__token != "/dev/urandom" && __token != "/dev/random") if ((__token != "/dev/urandom" && __token != "/dev/random")
|| !_M_filebuf.open(__token.c_str(), || !(_M_file = std::fopen(__token.c_str(), "rb")))
std::ios_base::in | std::ios_base::binary))
std::__throw_runtime_error(__N("random_device::" std::__throw_runtime_error(__N("random_device::"
"random_device(const std::string&)")); "random_device(const std::string&)"));
} }
~random_device() ~random_device()
{ _M_filebuf.close(); } { std::fclose(_M_file); }
#else #else
...@@ -1474,7 +1472,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) ...@@ -1474,7 +1472,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
{ {
#ifdef _GLIBCXX_USE_RANDOM_TR1 #ifdef _GLIBCXX_USE_RANDOM_TR1
result_type __ret; result_type __ret;
_M_filebuf.sgetn(reinterpret_cast<char*>(&__ret), sizeof(result_type)); std::fread(reinterpret_cast<void*>(&__ret), sizeof(result_type),
1, _M_file);
return __ret; return __ret;
#else #else
return _M_mt(); return _M_mt();
...@@ -1486,7 +1485,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) ...@@ -1486,7 +1485,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
void operator=(const random_device&); void operator=(const random_device&);
#ifdef _GLIBCXX_USE_RANDOM_TR1 #ifdef _GLIBCXX_USE_RANDOM_TR1
std::filebuf _M_filebuf; FILE* _M_file;
#else #else
mt19937 _M_mt; mt19937 _M_mt;
#endif #endif
......
// 2002-01-23 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org> // 2002-01-23 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org>
// //
// Copyright (C) 2002, 2003, 2004, 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 // 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
...@@ -30,9 +31,7 @@ ...@@ -30,9 +31,7 @@
// if the STL threading support is fubar'd). // if the STL threading support is fubar'd).
#include <list> #include <list>
#include <pthread.h>
// Do not include <pthread.h> explicitly; if threads are properly
// configured for the port, then it is picked up free from STL headers.
using namespace std; using namespace std;
......
// 2002-01-23 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org> // 2002-01-23 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org>
// Adpated from libstdc++/5347 submitted by markus.breuer@materna.de // Adpated from libstdc++/5347 submitted by markus.breuer@materna.de
// //
// Copyright (C) 2002, 2003 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 // 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
...@@ -24,9 +25,7 @@ ...@@ -24,9 +25,7 @@
// { dg-options "-pthreads" { target *-*-solaris* } } // { dg-options "-pthreads" { target *-*-solaris* } }
#include <fstream> #include <fstream>
#include <pthread.h>
// Do not include <pthread.h> explicitly; if threads are properly
// configured for the port, then it is picked up free from STL headers.
const int max_thread_count = 2; const int max_thread_count = 2;
const int max_loop_count = 1000000; const int max_loop_count = 1000000;
......
// 2002-01-23 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org> // 2002-01-23 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org>
// Adpated from libstdc++/5347 submitted by markus.breuer@materna.de // Adpated from libstdc++/5347 submitted by markus.breuer@materna.de
// //
// Copyright (C) 2002, 2003 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 // 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
...@@ -24,9 +25,7 @@ ...@@ -24,9 +25,7 @@
// { dg-options "-pthreads" { target *-*-solaris* } } // { dg-options "-pthreads" { target *-*-solaris* } }
#include <sstream> #include <sstream>
#include <pthread.h>
// Do not include <pthread.h> explicitly; if threads are properly
// configured for the port, then it is picked up free from STL headers.
const int max_thread_count = 2; const int max_thread_count = 2;
const int max_loop_count = 1000000; const int max_loop_count = 1000000;
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
// Adapted from http://gcc.gnu.org/ml/gcc-bugs/2002-01/msg00679.html // Adapted from http://gcc.gnu.org/ml/gcc-bugs/2002-01/msg00679.html
// which was adapted from pthread1.cc by Mike Lu <MLu@dynamicsoft.com> // which was adapted from pthread1.cc by Mike Lu <MLu@dynamicsoft.com>
// //
// Copyright (C) 2002, 2003, 2004, 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 // 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
...@@ -26,9 +27,7 @@ ...@@ -26,9 +27,7 @@
#include <string> #include <string>
#include <list> #include <list>
#include <pthread.h>
// Do not include <pthread.h> explicitly; if threads are properly
// configured for the port, then it is picked up free from STL headers.
using namespace std; using namespace std;
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
// Adpated from libstdc++/5464 submitted by jjessel@amadeus.net // Adpated from libstdc++/5464 submitted by jjessel@amadeus.net
// Jean-Francois JESSEL (Amadeus SAS Development) // Jean-Francois JESSEL (Amadeus SAS Development)
// //
// Copyright (C) 2002, 2003, 2004, 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 // 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
...@@ -27,9 +28,7 @@ ...@@ -27,9 +28,7 @@
#include <vector> #include <vector>
#include <list> #include <list>
#include <string> #include <string>
#include <pthread.h>
// Do not include <pthread.h> explicitly; if threads are properly
// configured for the port, then it is picked up free from STL headers.
#ifdef _GLIBCXX_HAVE_UNISTD_H #ifdef _GLIBCXX_HAVE_UNISTD_H
#include <unistd.h> // To test for _POSIX_THREAD_PRIORITY_SCHEDULING #include <unistd.h> // To test for _POSIX_THREAD_PRIORITY_SCHEDULING
......
// 2002-01-23 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org> // 2002-01-23 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org>
// Adpated from libstdc++/5444 submitted by markus.breuer@materna.de // Adpated from libstdc++/5444 submitted by markus.breuer@materna.de
// //
// Copyright (C) 2002, 2003, 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 // 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
...@@ -26,9 +27,7 @@ ...@@ -26,9 +27,7 @@
#include <string> #include <string>
#include <map> #include <map>
#include <vector> #include <vector>
#include <pthread.h>
// Do not include <pthread.h> explicitly; if threads are properly
// configured for the port, then it is picked up free from STL headers.
const int max_thread_count = 8; const int max_thread_count = 8;
const int loops = 100000; const int loops = 100000;
......
// 2003-05-03 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org> // 2003-05-03 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org>
// //
// Copyright (C) 2003, 2004, 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 // 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
...@@ -24,11 +24,9 @@ ...@@ -24,11 +24,9 @@
#include <ext/rope> #include <ext/rope>
#include <cstring> #include <cstring>
#include <pthread.h>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
// Do not include <pthread.h> explicitly; if threads are properly
// configured for the port, then it is picked up free from STL headers.
const int max_thread_count = 4; const int max_thread_count = 4;
const int max_loop_count = 10000; const int max_loop_count = 10000;
......
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