Make deprecated strstream header consistent with new and new.h.
authorBenjamin Kosnik <bkoz@redhat.com>
Thu, 23 Nov 2000 06:46:31 +0000 (06:46 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Thu, 23 Nov 2000 06:46:31 +0000 (06:46 +0000)
2000-11-22  Benjamin Kosnik  <bkoz@redhat.com>

Make deprecated strstream header consistent with new and new.h.
* include/backward/strstream.h: Add. Use using declarations to
scope strstreambuf, istrstream, ostrstream, strstream to global
scope.
* include/backward/strstream: Remove using declarations.
* src/Makefile.am (base_headers): Add strstream.
* src/Makefile.in: Regenerate.

* include/backward/new.h (_CPP_BACKWARD_NEW_H): Change macro guard
to be consistent with other headers.

From-SVN: r37692

libstdc++-v3/ChangeLog
libstdc++-v3/include/backward/new.h
libstdc++-v3/include/backward/strstream.h
libstdc++-v3/src/Makefile.am
libstdc++-v3/src/Makefile.in

index 612c04387e164be1c9faaaa7afcec35c262a3d8b..da450846aa1547036c261ccaba540dba940ffe61 100644 (file)
        * src/ios.cc (ios_base::failure::~failure): ... here.
        src/ios.cc (ios::failure::what): Likewise.
 
+2000-11-22  Benjamin Kosnik  <bkoz@redhat.com>
+
+       Make deprecated strstream header consistent with new and new.h.
+       * include/backward/strstream.h: Add. Use using declarations to
+       scope strstreambuf, istrstream, ostrstream, strstream to global
+       scope.
+       * include/backward/strstream: Remove using declarations.
+       * src/Makefile.am (base_headers): Add strstream.
+       * src/Makefile.in: Regenerate.
+
+       * include/backward/new.h (_CPP_BACKWARD_NEW_H): Change macro guard
+       to be consistent with other headers.
+
 2000-11-22  Richard Henderson  <rth@redhat.com>
 
        * config/os/bsd/bits/ctype_inline.h (is): Fix order of expressions.
index f04e3585a22fa8a6831cf5afce5ed4e2a8fd2924..e888126cf7775866b824843f0bcfca6bbaa25261 100644 (file)
@@ -27,8 +27,8 @@
 // invalidate any other reasons why the executable file might be covered by
 // the GNU General Public License.
 
-#ifndef __NEW_H__
-#define __NEW_H__
+#ifndef _CPP_BACKWARD_NEW_H
+#define _CPP_BACKWARD_NEW_H 1
 
 #include <new>
 
@@ -38,4 +38,4 @@ using std::nothrow;
 using std::new_handler;
 using std::set_new_handler;
 
-#endif // __NEW_H__
+#endif 
index 6568ddc995b42af9bc7c3ff0e133ac356be57ddc..72fe529cfea43ecfac0b3ee21bcb15eab4e89f2a 100644 (file)
-/*
- * Copyright (c) 1998
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.  Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose.  It is provided "as is" without express or implied warranty.
- */
-
-// WARNING: The classes defined in this header are DEPRECATED.  This
-// header is defined in section D.7.1 of the C++ standard, and it
-// MAY BE REMOVED in a future standard revision.  You should use the
-// header <sstream> instead.
-
-#ifndef __SGI_STL_STRSTREAM
-#define __SGI_STL_STRSTREAM
-
-#if defined(__sgi) && !defined(__GNUC__) && !defined(_STANDARD_C_PLUS_PLUS)
-#error This header file requires the -LANG:std option
-#endif
-
-#include <bits/std_iosfwd.h>
-#include <bits/std_ios.h>
-#include <bits/std_istream.h>
-#include <bits/std_ostream.h>
-#include <bits/std_string.h>
-
-__STL_BEGIN_NAMESPACE
-
-//----------------------------------------------------------------------
-// Class strstreambuf, a streambuf class that manages an array of char.
-// Note that this class is not a template.
-
-class strstreambuf : public basic_streambuf<char, char_traits<char> >
-{
-public:                         // Types.
-  typedef char_traits<char>              _Traits;
-  typedef basic_streambuf<char, _Traits> _Base;
-
-public:                         // Constructor, destructor
-  explicit strstreambuf(streamsize __initial_capacity = 0);
-  strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
-
-  strstreambuf(char* __get, streamsize __n, char* __put = 0);
-  strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
-  strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
-
-  strstreambuf(const char* __get, streamsize __n);
-  strstreambuf(const signed char* __get, streamsize __n);
-  strstreambuf(const unsigned char* __get, streamsize __n);
-
-  virtual ~strstreambuf();
-
-public:                         // strstreambuf operations.
-  void freeze(bool = true);
-  char* str();
-  int pcount() const;
-
-protected:                      // Overridden virtual member functions.
-  virtual int_type overflow(int_type __c  = _Traits::eof());
-  virtual int_type pbackfail(int_type __c = _Traits::eof());
-  virtual int_type underflow();
-  virtual _Base* setbuf(char* __buf, streamsize __n);
-  virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
-                           ios_base::openmode __mode
-                                      = ios_base::in | ios_base::out);
-  virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
-                                      = ios_base::in | ios_base::out);
-
-private:                        // Helper functions.
-  // Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
-  char* _M_alloc(size_t);
-  void  _M_free(char*);
-
-  // Helper function used in constructors.
-  void _M_setup(char* __get, char* __put, streamsize __n);
-
-private:                        // Data members.
-  void* (*_M_alloc_fun)(size_t);
-  void  (*_M_free_fun)(void*);
-
-  bool _M_dynamic  : 1;
-  bool _M_frozen   : 1;
-  bool _M_constant : 1;
-};
-
-//----------------------------------------------------------------------
-// Class istrstream, an istream that manages a strstreambuf.
-
-class istrstream : public basic_istream<char>
-{
-public:
-  explicit istrstream(char*);
-  explicit istrstream(const char*);
-  istrstream(char* , streamsize);
-  istrstream(const char*, streamsize);
-  virtual ~istrstream();
-
-  strstreambuf* rdbuf() const;
-  char* str();
-
-private:
-  strstreambuf _M_buf;
-};
-
-//----------------------------------------------------------------------
-// Class ostrstream
-
-class ostrstream : public basic_ostream<char>
-{
-public:
-  ostrstream();
-  ostrstream(char*, int, ios_base::openmode = ios_base::out);
-  virtual ~ostrstream();
-
-  strstreambuf* rdbuf() const;
-  void freeze(bool = true);
-  char* str();
-  int pcount() const;
-
-private:
-  strstreambuf _M_buf;
-};
-
-//----------------------------------------------------------------------
-// Class strstream
-
-class strstream : public basic_iostream<char>
-{
-public:
-  typedef char                        char_type;
-  typedef char_traits<char>::int_type int_type;
-  typedef char_traits<char>::pos_type pos_type;
-  typedef char_traits<char>::off_type off_type;
-
-  strstream();
-  strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
-  virtual ~strstream();
-
-  strstreambuf* rdbuf() const;
-  void freeze(bool = true);
-  int pcount() const;
-  char* str();
-
-private:
-  strstreambuf _M_buf;
-};
-
-__STL_END_NAMESPACE
+// -*- C++ -*- forwarding header.
+// Copyright (C) 2000 Free Software Foundation
+
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+// 
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING.  If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _CPP_BACKWARD_STRSTREAM_H
+#define _CPP_BACKWARD_STRSTREAM_H 1
+
+#include <backward/strstream>
 
 using std::strstreambuf;
 using std::istrstream;
 using std::ostrstream;
 using std::strstream;
 
-#endif /* __SGI_STL_STRSTREAM */
-
-// Local Variables:
-// mode:C++
-// End:
-
+#endif 
 
index ce36d36e878dd2e2b250c72e2e57632869d8a9f3..b40864df86d4f1c410bbdd458842de6fbeeab52d 100644 (file)
@@ -21,7 +21,7 @@
 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 ## USA.
 
-## $Id: Makefile.am,v 1.49 2000/11/22 00:05:16 bkoz Exp $
+## $Id: Makefile.am,v 1.50 2000/11/22 17:55:06 bkoz Exp $
 
 AUTOMAKE_OPTIONS = 1.3 gnits
 MAINT_CHARSET = latin1
@@ -103,7 +103,7 @@ base_headers = \
        backward/multiset.h backward/pair.h backward/iostream.h \
        backward/rope.h backward/set.h backward/slist.h backward/stack.h \
        backward/tempbuf.h backward/tree.h backward/vector.h \
-       backward/fstream.h backward/strstream.h \
+       backward/fstream.h backward/strstream.h backward/strstream \
        bits/std_bitset.h bits/std_deque.h bits/std_functional.h \
        bits/std_iterator.h bits/std_list.h \
        bits/std_map.h bits/std_memory.h bits/std_numeric.h \
index 1ce33cb72a75fb6875c707126f8da8756eabcb17..71f8fcbf2d42659fbb121773a7acb644effe02e8 100644 (file)
@@ -147,7 +147,7 @@ CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
 INCLUDES =     -D_GNU_SOURCE -D_ISOC99_SOURCE -nostdinc++      $(CSHADOW_INCLUDES) $(LIBSUPCXX_INCLUDES) -I$(GLIBCPP_INCLUDE_DIR)      $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) -I$(top_builddir)/include         $(TOPLEVEL_INCLUDES)    
 
 
-base_headers =         bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h        bits/basic_string.h bits/std_string.h  bits/string.tcc  bits/generic_shadow.h bits/std_utility.h        bits/std_complex.h      bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h      bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h   bits/gslice.h bits/gslice_array.h bits/indirect_array.h         bits/exception_support.h        bits/std_fstream.h bits/std_iomanip.h   bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc         bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h    bits/std_istream.h bits/istream.tcc bits/std_locale.h   bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc     bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h      bits/streambuf.tcc bits/basic_file.h    bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h    bits/stl_pthread_alloc.h bits/pthread_allocimpl.h       bits/stl_threads.h bits/stl_iterator_base.h     backward/complex.h backward/iomanip.h backward/istream.h        backward/ostream.h backward/stream.h backward/streambuf.h       backward/algo.h backward/algobase.h backward/alloc.h    backward/bvector.h backward/defalloc.h backward/deque.h         backward/function.h backward/hash_map.h backward/hash_set.h     backward/hashtable.h backward/heap.h backward/iterator.h        backward/list.h backward/map.h backward/multimap.h backward/new.h       backward/multiset.h backward/pair.h backward/iostream.h         backward/rope.h backward/set.h backward/slist.h backward/stack.h        backward/tempbuf.h backward/tree.h backward/vector.h    backward/fstream.h backward/strstream.h         bits/std_bitset.h bits/std_deque.h bits/std_functional.h        bits/std_iterator.h bits/std_list.h     bits/std_map.h bits/std_memory.h bits/std_numeric.h     bits/std_queue.h bits/std_set.h bits/std_stack.h        bits/std_stdexcept.h bits/std_vector.h  bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h    bits/stl_deque.h bits/stl_function.h    bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h      bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h      bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h    bits/stl_relops.h bits/stl_set.h        bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h       bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h      bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h         bits/concept_checks.h bits/container_concepts.h         bits/sequence_concepts.h        ext/ropeimpl.h ext/stl_rope.h   ext/stl_bvector.h bits/stl_config.h bits/stl_construct.h        ext/stl_hashtable.h ext/stl_hash_fun.h  ext/hash_map ext/hash_set ext/rope ext/slist    ext/tree ext/bvector 
+base_headers =         bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h        bits/basic_string.h bits/std_string.h  bits/string.tcc  bits/generic_shadow.h bits/std_utility.h        bits/std_complex.h      bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h      bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h   bits/gslice.h bits/gslice_array.h bits/indirect_array.h         bits/exception_support.h        bits/std_fstream.h bits/std_iomanip.h   bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc         bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h    bits/std_istream.h bits/istream.tcc bits/std_locale.h   bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc     bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h      bits/streambuf.tcc bits/basic_file.h    bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h    bits/stl_pthread_alloc.h bits/pthread_allocimpl.h       bits/stl_threads.h bits/stl_iterator_base.h     backward/complex.h backward/iomanip.h backward/istream.h        backward/ostream.h backward/stream.h backward/streambuf.h       backward/algo.h backward/algobase.h backward/alloc.h    backward/bvector.h backward/defalloc.h backward/deque.h         backward/function.h backward/hash_map.h backward/hash_set.h     backward/hashtable.h backward/heap.h backward/iterator.h        backward/list.h backward/map.h backward/multimap.h backward/new.h       backward/multiset.h backward/pair.h backward/iostream.h         backward/rope.h backward/set.h backward/slist.h backward/stack.h        backward/tempbuf.h backward/tree.h backward/vector.h    backward/fstream.h backward/strstream.h backward/strstream      bits/std_bitset.h bits/std_deque.h bits/std_functional.h        bits/std_iterator.h bits/std_list.h     bits/std_map.h bits/std_memory.h bits/std_numeric.h     bits/std_queue.h bits/std_set.h bits/std_stack.h        bits/std_stdexcept.h bits/std_vector.h  bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h    bits/stl_deque.h bits/stl_function.h    bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h      bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h      bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h    bits/stl_relops.h bits/stl_set.h        bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h       bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h      bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h         bits/concept_checks.h bits/container_concepts.h         bits/sequence_concepts.h        ext/ropeimpl.h ext/stl_rope.h   ext/stl_bvector.h bits/stl_config.h bits/stl_construct.h        ext/stl_hashtable.h ext/stl_hash_fun.h  ext/hash_map ext/hash_set ext/rope ext/slist    ext/tree ext/bvector 
 
 
 c_base_headers =       bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h  bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h         bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h  bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h         bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h  bits/std_cwchar.h bits/std_cwctype.h