Commit 6a734d61 by Benjamin Kosnik Committed by Zack Weinberg

basic_file_stdio.cc (__gnu_internal::fopen_mode): New function.

2004-02-04  Benjamin Kosnik  <bkoz@redhat.com>
	    Zack Weinberg  <zack@codesourcery.com>

	* config/io/basic_file_stdio.cc (__gnu_internal::fopen_mode):
	New function.
	(__basic_file<char>::sys_open, __basic_file<char>::open): Use it.
	(__basic_file<char>::_M_open_mode): Delete.
	* config/io/basic_file_stdio.cc: Delete declaration of _M_open_mode.

	* testsuite/27_io/basic_filebuf/close/char/9964.cc
	* testsuite/27_io/basic_filebuf/open/char/9507.cc:
	Correct flags to filebuf::open calls.

	* config/abi/alpha-freebsd5/baseline_symbols.txt
	* config/abi/alpha-linux-gnu/baseline_symbols.txt
	* config/abi/hppa-linux-gnu/baseline_symbols.txt
	* config/abi/i386-freebsd4/baseline_symbols.txt
	* config/abi/i386-freebsd5/baseline_symbols.txt
	* config/abi/i486-linux-gnu/baseline_symbols.txt
	* config/abi/ia64-linux-gnu/baseline_symbols.txt
	* config/abi/mips-linux-gnu/baseline_symbols.txt
	* config/abi/sparc-freebsd5/baseline_symbols.txt
	* config/abi/sparc-linux-gnu/baseline_symbols.txt
	* config/abi/x86_64-linux-gnu/baseline_symbols.txt:
	Remove entry for __basic_file<char>::_M_open_mode.

From-SVN: r77298
parent f583e452
2004-02-04 Benjamin Kosnik <bkoz@redhat.com>
Zack Weinberg <zack@codesourcery.com>
* config/io/basic_file_stdio.cc (__gnu_internal::fopen_mode):
New function.
(__basic_file<char>::sys_open, __basic_file<char>::open): Use it.
(__basic_file<char>::_M_open_mode): Delete.
* config/io/basic_file_stdio.cc: Delete declaration of _M_open_mode.
* testsuite/27_io/basic_filebuf/close/char/9964.cc
* testsuite/27_io/basic_filebuf/open/char/9507.cc:
Correct flags to filebuf::open calls.
* config/abi/alpha-freebsd5/baseline_symbols.txt
* config/abi/alpha-linux-gnu/baseline_symbols.txt
* config/abi/hppa-linux-gnu/baseline_symbols.txt
* config/abi/i386-freebsd4/baseline_symbols.txt
* config/abi/i386-freebsd5/baseline_symbols.txt
* config/abi/i486-linux-gnu/baseline_symbols.txt
* config/abi/ia64-linux-gnu/baseline_symbols.txt
* config/abi/mips-linux-gnu/baseline_symbols.txt
* config/abi/sparc-freebsd5/baseline_symbols.txt
* config/abi/sparc-linux-gnu/baseline_symbols.txt
* config/abi/x86_64-linux-gnu/baseline_symbols.txt:
Remove entry for __basic_file<char>::_M_open_mode.
2004-02-04 Loren J. Rittle <ljrittle@acm.org> 2004-02-04 Loren J. Rittle <ljrittle@acm.org>
* testsuite/performance/20_util/allocator/insert.cc (main): Tweak. * testsuite/performance/20_util/allocator/insert.cc (main): Tweak.
...@@ -6,16 +32,16 @@ ...@@ -6,16 +32,16 @@
* testsuite/performance/20_util/producer_consumer.cc: New. * testsuite/performance/20_util/producer_consumer.cc: New.
* testsuite/performance/20_util/allocator/insert_insert.cc: Two loops. * testsuite/performance/20_util/allocator/insert_insert.cc: Two loops.
2004-02-04 Benjamin Kosnik <bkoz@redhat.com> 2004-02-04 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/performance/20_util/allocator.cc: Move to.. * testsuite/performance/20_util/allocator.cc: Move to..
* testsuite/performance/20_util/allocator/insert.cc: ...here. * testsuite/performance/20_util/allocator/insert.cc: ...here.
* testsuite/performance/20_util/allocator_thread.cc: Move to... * testsuite/performance/20_util/allocator_thread.cc: Move to...
* testsuite/performance/20_util/allocator/insert_insert.cc: ...here. * testsuite/performance/20_util/allocator/insert_insert.cc: ...here.
* testsuite/performance/20_util/allocator_map_thread.cc: Move to... * testsuite/performance/20_util/allocator_map_thread.cc: Move to...
* testsuite/performance/20_util/allocator/map_thread.cc: ...here. * testsuite/performance/20_util/allocator/map_thread.cc: ...here.
2004-02-04 Jonathan Wakely <redi@gcc.gnu.org> 2004-02-04 Jonathan Wakely <redi@gcc.gnu.org>
* docs/html/faq/index.html: Recommend using LD_LIBRARY_PATH. * docs/html/faq/index.html: Recommend using LD_LIBRARY_PATH.
...@@ -32,11 +58,11 @@ ...@@ -32,11 +58,11 @@
2004-02-03 Felix Yen <fwy@alumni.brown.edu> 2004-02-03 Felix Yen <fwy@alumni.brown.edu>
Benjamin Kosnik <bkoz@redhat.com> Benjamin Kosnik <bkoz@redhat.com>
* testsuite/performance/20_util/allocator.cc: Add map, * testsuite/performance/20_util/allocator.cc: Add map,
deque, set tests. deque, set tests.
* testsuite/performance/20_util/allocator_thread.cc: Same. * testsuite/performance/20_util/allocator_thread.cc: Same.
2004-02-03 Paolo Carlini <pcarlini@suse.de> 2004-02-03 Paolo Carlini <pcarlini@suse.de>
* include/bits/basic_string.h (insert(iterator)): Remove, * include/bits/basic_string.h (insert(iterator)): Remove,
...@@ -71,29 +97,29 @@ ...@@ -71,29 +97,29 @@
2004-02-02 Benjamin Kosnik <bkoz@redhat.com> 2004-02-02 Benjamin Kosnik <bkoz@redhat.com>
* docs/html/19_diagnostics/howto.html: Move verbose terminate * docs/html/19_diagnostics/howto.html: Move verbose terminate
documentation... documentation...
* docs/html/18_support/howto.html: Here. * docs/html/18_support/howto.html: Here.
* docs/html/documentation.html: Add reference here. * docs/html/documentation.html: Add reference here.
2004-02-02 Paolo Carlini <pcarlini@suse.de> 2004-02-02 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/c++locale_internal.h: Remove prototypes * config/locale/gnu/c++locale_internal.h: Remove prototypes
of no longer used GLIBC thread locale functions. of no longer used GLIBC thread locale functions.
2004-02-02 Eric Christopher <echristo@redhat.com> 2004-02-02 Eric Christopher <echristo@redhat.com>
Zack Weinberg <zack@codesourcery.com> Zack Weinberg <zack@codesourcery.com>
* testsuite/22_locale/collate/compare/wchar_t/2.cc: Remove xfail. Use * testsuite/22_locale/collate/compare/wchar_t/2.cc: Remove xfail. Use
-finput-charset. -finput-charset.
* testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc: Ditto. * testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc: Ditto.
* testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc: Ditto * testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc: Ditto
* testsuite/22_locale/collate/hash/wchar_t/2.cc: Ditto. * testsuite/22_locale/collate/hash/wchar_t/2.cc: Ditto.
* testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc: Ditto. * testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc: Ditto.
* testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc: Ditto. * testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc: Ditto.
* testsuite/22_locale/collate/transform/wchar_t/2.cc: Ditto. * testsuite/22_locale/collate/transform/wchar_t/2.cc: Ditto.
* testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc: Ditto. * testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc: Ditto.
* testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc: * testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc:
Ditto. Ditto.
2004-02-02 Paolo Carlini <pcarlini@suse.de> 2004-02-02 Paolo Carlini <pcarlini@suse.de>
...@@ -380,10 +406,10 @@ ...@@ -380,10 +406,10 @@
PR libstdc++/11584 PR libstdc++/11584
* include/bits/ios_base.h (ios_base::_M_grow_words): Add * include/bits/ios_base.h (ios_base::_M_grow_words): Add
iword/pword selector. iword/pword selector.
(ios_base::iword, ios_base::pword): Use it. (ios_base::iword, ios_base::pword): Use it.
* src/ios.cc (ios_base::_M_grow_words): Clear _M_word_zero * src/ios.cc (ios_base::_M_grow_words): Clear _M_word_zero
iword or pword member on alloc failure. iword or pword member on alloc failure.
* testsuite/27_io/ios_base/storage/11584.cc: New test. * testsuite/27_io/ios_base/storage/11584.cc: New test.
2004-01-27 Ulrich Weigand <uweigand@de.ibm.com> 2004-01-27 Ulrich Weigand <uweigand@de.ibm.com>
...@@ -964,28 +990,28 @@ ...@@ -964,28 +990,28 @@
* include/bits/stl_list.h: * include/bits/stl_list.h:
* include/bits/list.tc: * include/bits/list.tc:
* src/list.cc: * src/list.cc:
Performance enhancements for destructor, push_front(), Performance enhancements for destructor, push_front(),
push_back(), pop_front(), pop_back(), sort() push_back(), pop_front(), pop_back(), sort()
Eliminated static_casts where possible. Eliminated static_casts where possible.
Moved code out of header files into new src/list.cc Moved code out of header files into new src/list.cc
implementation file for library where possible. implementation file for library where possible.
Remove inheritance from iterator class and create separate Remove inheritance from iterator class and create separate
classes for non-constant and constant iterators. classes for non-constant and constant iterators.
* include/bits/stl_tree.h (_Rb_tree class): * include/bits/stl_tree.h (_Rb_tree class):
* src/tree.cc: * src/tree.cc:
Only erase contents in destructor. Only erase contents in destructor.
Eliminate unnecessary initialization in assignment operator. Eliminate unnecessary initialization in assignment operator.
Optimize for the nominal case by not checking whether Optimize for the nominal case by not checking whether
container is empty in clear(). container is empty in clear().
Re-order test in _M_insert() to improve performance. Re-order test in _M_insert() to improve performance.
Move initialization of new node's left & right pointers to Move initialization of new node's left & right pointers to
src/tree.cc to where new node's colour is initialized src/tree.cc to where new node's colour is initialized
and to reduce the amount of inline code. and to reduce the amount of inline code.
Use _M_leftmost() and _M_end() to improve readability where Use _M_leftmost() and _M_end() to improve readability where
appropriate. appropriate.
Create separate classes for non-constant and constant Create separate classes for non-constant and constant
iterators to clarify code, avoid extra template parameters and iterators to clarify code, avoid extra template parameters and
casting away constness. casting away constness.
2004-01-07 Benjamin Kosnik <bkoz@redhat.com> 2004-01-07 Benjamin Kosnik <bkoz@redhat.com>
...@@ -1040,7 +1066,7 @@ ...@@ -1040,7 +1066,7 @@
redundant #include. redundant #include.
2004-01-06 Benjamin Kosnik <bkoz@redhat.com> 2004-01-06 Benjamin Kosnik <bkoz@redhat.com>
Stefan Olsson <stefan@snon.net> Stefan Olsson <stefan@snon.net>
* scripts/check_performance: Use -pthread. * scripts/check_performance: Use -pthread.
* testsuite/performance/allocator.cc: Tweaks, add list. * testsuite/performance/allocator.cc: Tweaks, add list.
......
...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2 ...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3 FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
......
...@@ -982,7 +982,6 @@ FUNC:_ZNSt11__timepunctIwED0Ev@@GLIBCPP_3.2 ...@@ -982,7 +982,6 @@ FUNC:_ZNSt11__timepunctIwED0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11__timepunctIwED1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11__timepunctIwED1Ev@@GLIBCPP_3.2
FUNC:_ZNSt11__timepunctIwED2Ev@@GLIBCPP_3.2 FUNC:_ZNSt11__timepunctIwED2Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4syncEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4syncEv@@GLIBCPP_3.2
......
...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2 ...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3 FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
......
...@@ -553,7 +553,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2 ...@@ -553,7 +553,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3 FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
......
...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2 ...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3 FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
......
...@@ -999,7 +999,6 @@ FUNC:_ZNSt11__timepunctIwED0Ev@@GLIBCPP_3.2 ...@@ -999,7 +999,6 @@ FUNC:_ZNSt11__timepunctIwED0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11__timepunctIwED1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11__timepunctIwED1Ev@@GLIBCPP_3.2
FUNC:_ZNSt11__timepunctIwED2Ev@@GLIBCPP_3.2 FUNC:_ZNSt11__timepunctIwED2Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3 FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
......
...@@ -982,7 +982,6 @@ FUNC:_ZNSt11__timepunctIwED0Ev@@GLIBCPP_3.2 ...@@ -982,7 +982,6 @@ FUNC:_ZNSt11__timepunctIwED0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11__timepunctIwED1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11__timepunctIwED1Ev@@GLIBCPP_3.2
FUNC:_ZNSt11__timepunctIwED2Ev@@GLIBCPP_3.2 FUNC:_ZNSt11__timepunctIwED2Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4syncEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4syncEv@@GLIBCPP_3.2
......
...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2 ...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3 FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
......
...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2 ...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3 FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
......
...@@ -1005,7 +1005,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2 ...@@ -1005,7 +1005,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3 FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
......
...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2 ...@@ -946,7 +946,6 @@ FUNC:_ZNSt11range_errorC2ERKSs@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2 FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3 FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
......
// Wrapper of C-language FILE struct -*- C++ -*- // Wrapper of C-language FILE struct -*- C++ -*-
// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. // Copyright (C) 2000, 2001, 2002, 2003, 2004 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
...@@ -70,6 +70,43 @@ ...@@ -70,6 +70,43 @@
#include <limits> // For <off_t>::max() and min() #include <limits> // For <off_t>::max() and min()
namespace __gnu_internal
{
// Map ios_base::openmode flags to a string for use in fopen().
// Table of valid combinations as given in [lib.filebuf.members]/2.
static const char*
fopen_mode(std::ios_base::openmode mode)
{
enum
{
in = std::ios_base::in,
out = std::ios_base::out,
trunc = std::ios_base::trunc,
app = std::ios_base::app,
binary = std::ios_base::binary
};
switch (mode & (in|out|trunc|app|binary))
{
case ( out ): return "w";
case ( out |app ): return "a";
case ( out|trunc ): return "w";
case (in ): return "r";
case (in|out ): return "r+";
case (in|out|trunc ): return "w+";
case ( out |binary): return "wb";
case ( out |app|binary): return "ab";
case ( out|trunc |binary): return "wb";
case (in |binary): return "rb";
case (in|out |binary): return "r+b";
case (in|out|trunc |binary): return "w+b";
default: return 0; // invalid
}
}
} // namespace __gnu_internal
namespace std namespace std
{ {
// Definitions for __basic_file<char>. // Definitions for __basic_file<char>.
...@@ -79,53 +116,6 @@ namespace std ...@@ -79,53 +116,6 @@ namespace std
__basic_file<char>::~__basic_file() __basic_file<char>::~__basic_file()
{ this->close(); } { this->close(); }
void
__basic_file<char>::_M_open_mode(ios_base::openmode __mode, int& __p_mode,
int&, char* __c_mode)
{
bool __testb = __mode & ios_base::binary;
bool __testi = __mode & ios_base::in;
bool __testo = __mode & ios_base::out;
bool __testt = __mode & ios_base::trunc;
bool __testa = __mode & ios_base::app;
// Set __c_mode for use in fopen.
// Set __p_mode for use in open.
if (!__testi && __testo && !__testt && !__testa)
{
strcpy(__c_mode, "w");
__p_mode = O_WRONLY | O_CREAT;
}
if (!__testi && __testo && !__testt && __testa)
{
strcpy(__c_mode, "a");
__p_mode = O_WRONLY | O_CREAT | O_APPEND;
}
if (!__testi && __testo && __testt && !__testa)
{
strcpy(__c_mode, "w");
__p_mode = O_WRONLY | O_CREAT | O_TRUNC;
}
if (__testi && !__testo && !__testt && !__testa)
{
strcpy(__c_mode, "r");
__p_mode = O_RDONLY;
}
if (__testi && __testo && !__testt && !__testa)
{
strcpy(__c_mode, "r+");
__p_mode = O_RDWR | O_CREAT;
}
if (__testi && __testo && __testt && !__testa)
{
strcpy(__c_mode, "w+");
__p_mode = O_RDWR | O_CREAT | O_TRUNC;
}
if (__testb)
strcat(__c_mode, "b");
}
__basic_file<char>* __basic_file<char>*
__basic_file<char>::sys_open(__c_file* __file, ios_base::openmode) __basic_file<char>::sys_open(__c_file* __file, ios_base::openmode)
{ {
...@@ -144,12 +134,9 @@ namespace std ...@@ -144,12 +134,9 @@ namespace std
__basic_file<char>::sys_open(int __fd, ios_base::openmode __mode) __basic_file<char>::sys_open(int __fd, ios_base::openmode __mode)
{ {
__basic_file* __ret = NULL; __basic_file* __ret = NULL;
int __p_mode = 0; const char* __c_mode = __gnu_internal::fopen_mode(__mode);
int __rw_mode = 0; if (__c_mode && !this->is_open()
char __c_mode[4]; && (_M_cfile = fdopen(__fd, __c_mode)))
_M_open_mode(__mode, __p_mode, __rw_mode, __c_mode);
if (!this->is_open() && (_M_cfile = fdopen(__fd, __c_mode)))
{ {
_M_cfile_created = true; _M_cfile_created = true;
if (__fd == 0) if (__fd == 0)
...@@ -164,13 +151,8 @@ namespace std ...@@ -164,13 +151,8 @@ namespace std
int /*__prot*/) int /*__prot*/)
{ {
__basic_file* __ret = NULL; __basic_file* __ret = NULL;
int __p_mode = 0; const char* __c_mode = __gnu_internal::fopen_mode(__mode);
int __rw_mode = 0; if (__c_mode && !this->is_open())
char __c_mode[4];
_M_open_mode(__mode, __p_mode, __rw_mode, __c_mode);
if (!this->is_open())
{ {
#ifdef _GLIBCXX_USE_LFS #ifdef _GLIBCXX_USE_LFS
if ((_M_cfile = fopen64(__name, __c_mode))) if ((_M_cfile = fopen64(__name, __c_mode)))
...@@ -309,5 +291,4 @@ namespace std ...@@ -309,5 +291,4 @@ namespace std
#endif #endif
return 0; return 0;
} }
} // namespace std } // namespace std
// Wrapper of C-language FILE struct -*- C++ -*- // Wrapper of C-language FILE struct -*- C++ -*-
// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. // Copyright (C) 2000, 2001, 2002, 2003, 2004 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
...@@ -62,11 +62,7 @@ namespace std ...@@ -62,11 +62,7 @@ namespace std
public: public:
__basic_file(__c_lock* __lock = 0); __basic_file(__c_lock* __lock = 0);
void
_M_open_mode(ios_base::openmode __mode, int& __p_mode, int& __rw_mode,
char* __c_mode);
__basic_file* __basic_file*
open(const char* __name, ios_base::openmode __mode, int __prot = 0664); open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
......
...@@ -59,7 +59,7 @@ void test_07() ...@@ -59,7 +59,7 @@ void test_07()
filebuf fb; filebuf fb;
sleep(1); sleep(1);
filebuf* ret = fb.open(name, ios_base::out | ios_base::trunc); filebuf* ret = fb.open(name, ios_base::in | ios_base::out);
VERIFY( ret != NULL ); VERIFY( ret != NULL );
VERIFY( fb.is_open() ); VERIFY( fb.is_open() );
...@@ -67,7 +67,7 @@ void test_07() ...@@ -67,7 +67,7 @@ void test_07()
fb.sputc('a'); fb.sputc('a');
ret = fb.close(); ret = fb.close();
VERIFY( ret == NULL ); VERIFY( ret != NULL );
VERIFY( !fb.is_open() ); VERIFY( !fb.is_open() );
} }
......
...@@ -53,7 +53,10 @@ void test_06() ...@@ -53,7 +53,10 @@ void test_06()
} }
std::filebuf fbuf; std::filebuf fbuf;
std::filebuf* r = fbuf.open(name, std::ios_base::out | std::ios_base::ate); std::filebuf* r = fbuf.open(name,
std::ios_base::in
| std::ios_base::out
| std::ios_base::ate);
VERIFY( !fbuf.is_open() ); VERIFY( !fbuf.is_open() );
VERIFY( r == NULL ); VERIFY( r == NULL );
} }
......
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