c++config (_GLIBCPP_EXTERN_TEMPLATE): Define.

2003-02-13  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/c++config (_GLIBCPP_EXTERN_TEMPLATE): Define.
	* include/bits/basic_ios.tcc: Guard use of extern template.
	* include/std/std_iomanip.h: Same.
	* include/bits/streambuf.tcc: Same.
	* include/bits/stl_alloc.h: Same.
	* include/bits/locale_facets.tcc: Same.
	* include/bits/ostream.tcc: Same.
	* include/bits/istream.tcc: Same.
	* include/bits/fstream.tcc: Same.
	* include/bits/basic_string.tcc: Same.

From-SVN: r62865
This commit is contained in:
Benjamin Kosnik 2003-02-13 21:39:03 +00:00 committed by Benjamin Kosnik
parent 659efb326d
commit 1bc8b0ad4e
11 changed files with 50 additions and 8 deletions

View File

@ -1,3 +1,16 @@
2003-02-13 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/c++config (_GLIBCPP_EXTERN_TEMPLATE): Define.
* include/bits/basic_ios.tcc: Guard use of extern template.
* include/std/std_iomanip.h: Same.
* include/bits/streambuf.tcc: Same.
* include/bits/stl_alloc.h: Same.
* include/bits/locale_facets.tcc: Same.
* include/bits/ostream.tcc: Same.
* include/bits/istream.tcc: Same.
* include/bits/fstream.tcc: Same.
* include/bits/basic_string.tcc: Same.
2003-02-13 Paolo Carlini <pcarlini@unitus.it>
* include/bits/ostream.tcc (sentry::sentry): Improve

View File

@ -1,6 +1,6 @@
// basic_ios locale and locale-related member functions -*- C++ -*-
// Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
// Copyright (C) 1999, 2001, 2002, 2003 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
@ -186,11 +186,13 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCPP_EXTERN_TEMPLATE
extern template class basic_ios<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
extern template class basic_ios<wchar_t>;
#endif
#endif
} // namespace std
#endif

View File

@ -1,6 +1,6 @@
// Components for manipulating sequences of characters -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -933,6 +933,7 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCPP_EXTERN_TEMPLATE
extern template class basic_string<char>;
extern template
basic_istream<char>&
@ -962,6 +963,7 @@ namespace std
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&);
#endif
#endif
} // namespace std
#endif

View File

@ -1,6 +1,7 @@
// Predefined symbols and macros -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
// 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,8 +37,7 @@
// The current version of the C++ library in compressed ISO date format.
#define __GLIBCPP__ 20030213
// This is necessary until GCC supports separate template
// compilation.
// This is necessary until GCC supports separate template compilation.
#define _GLIBCPP_NO_TEMPLATE_EXPORT 1
// This is a hack around not having either pre-compiled headers or
@ -49,6 +49,16 @@
// by the compiler, but instead instantiated into the library binary.
#define _GLIBCPP_FULLY_COMPLIANT_HEADERS 1
// Allow use of the GNU syntax extension, "extern template." This
// extension is fully documented in the g++ manual, but in a nutshell,
// it inhibits all implicit instantiations and is used throughout the
// library to avoid multiple weak definitions for required types that
// are already explicitly instantiated in the library binary. This
// substantially reduces the binary size of resulting executables.
#ifndef _GLIBCPP_EXTERN_TEMPLATE
#define _GLIBCPP_EXTERN_TEMPLATE 1
#endif
// To enable older, ARM-style iostreams and other anachronisms use this.
//#define _GLIBCPP_DEPRECATED 1

View File

@ -505,6 +505,7 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCPP_EXTERN_TEMPLATE
extern template class basic_filebuf<char>;
extern template class basic_ifstream<char>;
extern template class basic_ofstream<char>;
@ -516,6 +517,7 @@ namespace std
extern template class basic_ofstream<wchar_t>;
extern template class basic_fstream<wchar_t>;
#endif
#endif
} // namespace std
#endif

View File

@ -1,6 +1,6 @@
// istream classes -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -1189,6 +1189,7 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCPP_EXTERN_TEMPLATE
extern template class basic_istream<char>;
extern template istream& ws(istream&);
extern template istream& operator>>(istream&, char&);
@ -1204,4 +1205,5 @@ namespace std
extern template wistream& operator>>(wistream&, wchar_t&);
extern template wistream& operator>>(wistream&, wchar_t*);
#endif
#endif
} // namespace std

View File

@ -2219,6 +2219,7 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCPP_EXTERN_TEMPLATE
extern template class moneypunct<char, false>;
extern template class moneypunct<char, true>;
extern template class moneypunct_byname<char, false>;
@ -2472,6 +2473,7 @@ namespace std
bool
has_facet<messages<wchar_t> >(const locale&);
#endif
#endif
} // namespace std
#endif

View File

@ -701,6 +701,7 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCPP_EXTERN_TEMPLATE
extern template class basic_ostream<char>;
extern template ostream& endl(ostream&);
extern template ostream& ends(ostream&);
@ -722,4 +723,5 @@ namespace std
extern template wostream& operator<<(wostream&, const wchar_t*);
extern template wostream& operator<<(wostream&, const char*);
#endif
#endif
} // namespace std

View File

@ -898,9 +898,11 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCPP_EXTERN_TEMPLATE
extern template class allocator<char>;
extern template class allocator<wchar_t>;
extern template class __pool_alloc<true,0>;
#endif
} // namespace std
#endif

View File

@ -1,6 +1,6 @@
// Stream buffer classes -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -245,6 +245,7 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCPP_EXTERN_TEMPLATE
extern template class basic_streambuf<char>;
extern template
streamsize
@ -258,6 +259,7 @@ namespace std
__copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
basic_streambuf<wchar_t>*);
#endif
#endif
} // namespace std
#endif

View File

@ -1,6 +1,7 @@
// Standard stream manipulators -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
// 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
@ -265,6 +266,7 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCPP_EXTERN_TEMPLATE
extern template ostream& operator<<(ostream&, _Setfill<char>);
extern template ostream& operator<<(ostream&, _Setiosflags);
extern template ostream& operator<<(ostream&, _Resetiosflags);
@ -292,6 +294,7 @@ namespace std
extern template wistream& operator>>(wistream&, _Setprecision);
extern template wistream& operator>>(wistream&, _Setw);
#endif
#endif
} // namespace std
#endif