From 9ef8440e664c73197c37933243da87b903449879 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 1 Aug 2013 23:03:00 +0000 Subject: [PATCH] Revert the last 4 commits. git-svn is stupid git-svn-id: https://svn.dealii.org/trunk@30214 0785d39b-7218-0410-832d-ea1e28bc413d --- .../boost/signals2/detail/foreign_ptr.hpp | 21 +++--- deal.II/include/deal.II/dofs/dof_handler.h | 1 - deal.II/include/deal.II/grid/tria_accessor.h | 6 +- deal.II/source/base/logstream.cc | 66 ++++--------------- deal.II/source/numerics/data_out.inst.in | 4 +- 5 files changed, 27 insertions(+), 71 deletions(-) diff --git a/deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp b/deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp index 50496b50df..3e2357b8e8 100644 --- a/deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp +++ b/deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp @@ -18,6 +18,14 @@ #include #include +#if !defined(BOOST_INTEL_STDCXX0X) +namespace std +{ + template class shared_ptr; + template class weak_ptr; +} +#endif + namespace boost { template class shared_ptr; @@ -31,20 +39,10 @@ namespace boost { typedef boost::shared_ptr shared_type; }; - -// Workaround for a bug in boost: -// https://svn.boost.org/trac/boost/ticket/6655 -// -// It should be save to depend on DEAL macros at this point as this header -// should only be used by deal.II and dependend projects... -// -// - Maier, 2013 -#ifdef DEAL_II_CAN_USE_CXX11 template struct weak_ptr_traits > { typedef std::shared_ptr shared_type; }; -#endif template struct shared_ptr_traits {}; @@ -53,13 +51,10 @@ namespace boost { typedef boost::weak_ptr weak_type; }; -// as above -#ifdef DEAL_II_CAN_USE_CXX11 template struct shared_ptr_traits > { typedef std::weak_ptr weak_type; }; -#endif namespace detail { diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h index 93d765a670..9e990e154e 100644 --- a/deal.II/include/deal.II/dofs/dof_handler.h +++ b/deal.II/include/deal.II/dofs/dof_handler.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/deal.II/include/deal.II/grid/tria_accessor.h b/deal.II/include/deal.II/grid/tria_accessor.h index 7ff6297f2c..e0524d2291 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.h +++ b/deal.II/include/deal.II/grid/tria_accessor.h @@ -26,8 +26,12 @@ #include #include -#include +namespace std +{ + template + struct pair; +} DEAL_II_NAMESPACE_OPEN diff --git a/deal.II/source/base/logstream.cc b/deal.II/source/base/logstream.cc index e05f28a89b..ba7f8773f3 100644 --- a/deal.II/source/base/logstream.cc +++ b/deal.II/source/base/logstream.cc @@ -137,65 +137,23 @@ LogStream::operator<< (std::ostream& (*p) (std::ostream &)) // Print to the internal stringstream: stream << p; - - // This is a bloody hack until LogStream got reimplemented as a proper - // child of std::streambuf (or similar). - // - // The problem is that at this point we would like to know whether an - // std::flush or std::endl has called us, however, there is no way to - // detect this in a sane manner. - // - // The obvious idea to compare function pointers, - // std::ostream & (* const p_flush) (std::ostream &) = &std::flush; - // p == p_flush ? ..., - // is wrong as there doesn't has to be a _single_ std::flush instance... - // there could be multiple of it. And in fact, LLVM's libc++ implements - // std::flush and std::endl in a way that every shared library and - // executable has its local copy... fun... - // - // - Maier, 2013 - - class QueryStreambuf : public std::streambuf - { - // Implement a minimalistic stream buffer that only stores the fact - // whether overflow or sync was called - public: - QueryStreambuf() - : _flushed(false), _newline_written(false) - { - } - bool flushed() { return _flushed; } - bool newline_written() { return _newline_written; } - private: - int_type overflow(int_type ch) - { - _newline_written = true; - return ch; - } - int sync() - { - _flushed = true; - return 0; - } - bool _flushed; - bool _newline_written; - } query_streambuf; - - { - // and initialize an ostream with this streambuf: - std::ostream inject (&query_streambuf); - inject << p; - } - - if (query_streambuf.flushed()) + // Next check whether this is the flush or endl + // manipulator, and if so print out the message. + std::ostream & (* const p_flush) (std::ostream &) = &std::flush; + std::ostream & (* const p_endl) (std::ostream &) = &std::endl; + if (p == p_flush || p == p_endl) { Threads::Mutex::ScopedLock lock(write_lock); - // Print the line head in case of a previous newline: + // Print the line head in case of a newline: if (at_newline) print_line_head(); - at_newline = query_streambuf.newline_written(); + if (p == p_flush) + at_newline = false; + + if (p == p_endl) + at_newline = true; if (get_prefixes().size() <= std_depth) *std_out << stream.str(); @@ -203,7 +161,7 @@ LogStream::operator<< (std::ostream& (*p) (std::ostream &)) if (file && (get_prefixes().size() <= file_depth)) *file << stream.str() << std::flush; - // Start a new string: + // Start a new string stream.str(""); } diff --git a/deal.II/source/numerics/data_out.inst.in b/deal.II/source/numerics/data_out.inst.in index 8df3e2b0d6..87d0fd95c5 100644 --- a/deal.II/source/numerics/data_out.inst.in +++ b/deal.II/source/numerics/data_out.inst.in @@ -363,8 +363,8 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS) namespace internal \{ namespace DataOut \{ #if deal_II_dimension <= deal_II_space_dimension - template struct ParallelDataBase; - template struct ParallelData; + template class ParallelDataBase; + template class ParallelData; #endif \} \} -- 2.39.5