From e3dfd6d5558ea8f9e0834f843803812955ba3c25 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 6 Mar 2006 18:06:47 +0000 Subject: [PATCH] re PR target/26532 (libmudflap failures on ia64) 2006-03-06 Paolo Carlini PR target/26532 * config/io/c_io_stdio.h (struct __ios_flags): Remove. * include/bits/ios_base.h: Adjust consistently. (ios_base::_S_local_word_size): Change to an anonymous enum. * src/ios.cc: Do not define static const data of __ios_flags, likewise for ios_base::_S_local_word_size. * include/bits/locale_classes.h (locale::_S_categories_size): Change to an anonymous enum. * src/locale.cc: Don't define. From-SVN: r111789 --- libstdc++-v3/ChangeLog | 12 ++++++ libstdc++-v3/config/io/c_io_stdio.h | 41 +------------------ libstdc++-v3/include/bits/ios_base.h | 66 +++++++++++++++--------------- libstdc++-v3/include/bits/locale_classes.h | 4 +- libstdc++-v3/src/ios.cc | 36 +--------------- libstdc++-v3/src/locale.cc | 1 - 6 files changed, 49 insertions(+), 111 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a3c45a2..09f6ca1 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2006-03-06 Paolo Carlini + + PR target/26532 + * config/io/c_io_stdio.h (struct __ios_flags): Remove. + * include/bits/ios_base.h: Adjust consistently. + (ios_base::_S_local_word_size): Change to an anonymous enum. + * src/ios.cc: Do not define static const data of __ios_flags, + likewise for ios_base::_S_local_word_size. + * include/bits/locale_classes.h (locale::_S_categories_size): + Change to an anonymous enum. + * src/locale.cc: Don't define. + 2006-03-03 Paolo Carlini PR libstdc++/26526 diff --git a/libstdc++-v3/config/io/c_io_stdio.h b/libstdc++-v3/config/io/c_io_stdio.h index a1ed94a..96676b4 100644 --- a/libstdc++-v3/config/io/c_io_stdio.h +++ b/libstdc++-v3/config/io/c_io_stdio.h @@ -1,6 +1,6 @@ // Underlying io library details -*- C++ -*- -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -44,45 +44,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // for basic_file.h typedef FILE __c_file; - // XXX GLIBCXX_ABI Deprecated - // for ios_base.h - struct __ios_flags - { - typedef short __int_type; - - static const __int_type _S_boolalpha = 0x0001; - static const __int_type _S_dec = 0x0002; - static const __int_type _S_fixed = 0x0004; - static const __int_type _S_hex = 0x0008; - static const __int_type _S_internal = 0x0010; - static const __int_type _S_left = 0x0020; - static const __int_type _S_oct = 0x0040; - static const __int_type _S_right = 0x0080; - static const __int_type _S_scientific = 0x0100; - static const __int_type _S_showbase = 0x0200; - static const __int_type _S_showpoint = 0x0400; - static const __int_type _S_showpos = 0x0800; - static const __int_type _S_skipws = 0x1000; - static const __int_type _S_unitbuf = 0x2000; - static const __int_type _S_uppercase = 0x4000; - static const __int_type _S_adjustfield = 0x0020 | 0x0080 | 0x0010; - static const __int_type _S_basefield = 0x0002 | 0x0040 | 0x0008; - static const __int_type _S_floatfield = 0x0100 | 0x0004; - - // 27.4.2.1.3 Type ios_base::iostate - static const __int_type _S_badbit = 0x01; - static const __int_type _S_eofbit = 0x02; - static const __int_type _S_failbit = 0x04; - - // 27.4.2.1.4 Type openmode - static const __int_type _S_app = 0x01; - static const __int_type _S_ate = 0x02; - static const __int_type _S_bin = 0x04; - static const __int_type _S_in = 0x08; - static const __int_type _S_out = 0x10; - static const __int_type _S_trunc = 0x20; - }; - _GLIBCXX_END_NAMESPACE #endif diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h index cc88f40..9b69507 100644 --- a/libstdc++-v3/include/bits/ios_base.h +++ b/libstdc++-v3/include/bits/ios_base.h @@ -1,6 +1,6 @@ // Iostreams base classes -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -253,65 +253,65 @@ _GLIBCXX_BEGIN_NAMESPACE(std) typedef _Ios_Fmtflags fmtflags; /// Insert/extract @c bool in alphabetic rather than numeric format. - static const fmtflags boolalpha = fmtflags(__ios_flags::_S_boolalpha); + static const fmtflags boolalpha = _S_boolalpha; /// Converts integer input or generates integer output in decimal base. - static const fmtflags dec = fmtflags(__ios_flags::_S_dec); + static const fmtflags dec = _S_dec; /// Generate floating-point output in fixed-point notation. - static const fmtflags fixed = fmtflags(__ios_flags::_S_fixed); + static const fmtflags fixed = _S_fixed; /// Converts integer input or generates integer output in hexadecimal base. - static const fmtflags hex = fmtflags(__ios_flags::_S_hex); + static const fmtflags hex = _S_hex; /// Adds fill characters at a designated internal point in certain /// generated output, or identical to @c right if no such point is /// designated. - static const fmtflags internal = fmtflags(__ios_flags::_S_internal); + static const fmtflags internal = _S_internal; /// Adds fill characters on the right (final positions) of certain /// generated output. (I.e., the thing you print is flush left.) - static const fmtflags left = fmtflags(__ios_flags::_S_left); + static const fmtflags left = _S_left; /// Converts integer input or generates integer output in octal base. - static const fmtflags oct = fmtflags(__ios_flags::_S_oct); + static const fmtflags oct = _S_oct; /// Adds fill characters on the left (initial positions) of certain /// generated output. (I.e., the thing you print is flush right.) - static const fmtflags right = fmtflags(__ios_flags::_S_right); + static const fmtflags right = _S_right; /// Generates floating-point output in scientific notation. - static const fmtflags scientific = fmtflags(__ios_flags::_S_scientific); + static const fmtflags scientific = _S_scientific; /// Generates a prefix indicating the numeric base of generated integer /// output. - static const fmtflags showbase = fmtflags(__ios_flags::_S_showbase); + static const fmtflags showbase = _S_showbase; /// Generates a decimal-point character unconditionally in generated /// floating-point output. - static const fmtflags showpoint = fmtflags(__ios_flags::_S_showpoint); + static const fmtflags showpoint = _S_showpoint; /// Generates a + sign in non-negative generated numeric output. - static const fmtflags showpos = fmtflags(__ios_flags::_S_showpos); + static const fmtflags showpos = _S_showpos; /// Skips leading white space before certain input operations. - static const fmtflags skipws = fmtflags(__ios_flags::_S_skipws); + static const fmtflags skipws = _S_skipws; /// Flushes output after each output operation. - static const fmtflags unitbuf = fmtflags(__ios_flags::_S_unitbuf); + static const fmtflags unitbuf = _S_unitbuf; /// Replaces certain lowercase letters with their uppercase equivalents /// in generated output. - static const fmtflags uppercase = fmtflags(__ios_flags::_S_uppercase); + static const fmtflags uppercase = _S_uppercase; /// A mask of left|right|internal. Useful for the 2-arg form of @c setf. - static const fmtflags adjustfield = fmtflags(__ios_flags::_S_adjustfield); + static const fmtflags adjustfield = _S_adjustfield; /// A mask of dec|oct|hex. Useful for the 2-arg form of @c setf. - static const fmtflags basefield = fmtflags(__ios_flags::_S_basefield); + static const fmtflags basefield = _S_basefield; /// A mask of scientific|fixed. Useful for the 2-arg form of @c setf. - static const fmtflags floatfield = fmtflags(__ios_flags::_S_floatfield); + static const fmtflags floatfield = _S_floatfield; // 27.4.2.1.3 Type ios_base::iostate /** @@ -329,18 +329,18 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /// Indicates a loss of integrity in an input or output sequence (such /// as an irrecoverable read error from a file). - static const iostate badbit = iostate(__ios_flags::_S_badbit); + static const iostate badbit = _S_badbit; /// Indicates that an input operation reached the end of an input sequence. - static const iostate eofbit = iostate(__ios_flags::_S_eofbit); + static const iostate eofbit = _S_eofbit; /// Indicates that an input operation failed to read the expected /// characters, or that an output operation failed to generate the /// desired characters. - static const iostate failbit = iostate(__ios_flags::_S_failbit); + static const iostate failbit = _S_failbit; /// Indicates all is well. - static const iostate goodbit = iostate(0); + static const iostate goodbit = _S_goodbit; // 27.4.2.1.4 Type ios_base::openmode /** @@ -359,25 +359,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std) typedef _Ios_Openmode openmode; /// Seek to end before each write. - static const openmode app = openmode(__ios_flags::_S_app); + static const openmode app = _S_app; /// Open and seek to end immediately after opening. - static const openmode ate = openmode(__ios_flags::_S_ate); + static const openmode ate = _S_ate; /// Perform input and output in binary mode (as opposed to text mode). /// This is probably not what you think it is; see /// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#3 and /// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#7 for more. - static const openmode binary = openmode(__ios_flags::_S_bin); + static const openmode binary = _S_bin; /// Open for input. Default for @c ifstream and fstream. - static const openmode in = openmode(__ios_flags::_S_in); + static const openmode in = _S_in; /// Open for output. Default for @c ofstream and fstream. - static const openmode out = openmode(__ios_flags::_S_out); + static const openmode out = _S_out; /// Open for input. Default for @c ofstream. - static const openmode trunc = openmode(__ios_flags::_S_trunc); + static const openmode trunc = _S_trunc; // 27.4.2.1.5 Type ios_base::seekdir /** @@ -392,13 +392,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std) typedef _Ios_Seekdir seekdir; /// Request a seek relative to the beginning of the stream. - static const seekdir beg = seekdir(0); + static const seekdir beg = _S_beg; /// Request a seek relative to the current position within the sequence. - static const seekdir cur = seekdir(SEEK_CUR); + static const seekdir cur = _S_cur; /// Request a seek relative to the current end of the sequence. - static const seekdir end = seekdir(SEEK_END); + static const seekdir end = _S_end; // Annex D.6 typedef int io_state; @@ -505,7 +505,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // Guaranteed storage. // The first 5 iword and pword slots are reserved for internal use. - static const int _S_local_word_size = 8; + enum { _S_local_word_size = 8 }; _Words _M_local_word[_S_local_word_size]; // Allocated storage. diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h index 3abe415..f72b72a 100644 --- a/libstdc++-v3/include/bits/locale_classes.h +++ b/libstdc++-v3/include/bits/locale_classes.h @@ -1,6 +1,6 @@ // Locale support -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -307,7 +307,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // macros. For GNU systems, the following are also valid: // LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, // and LC_IDENTIFICATION. - static const size_t _S_categories_size = 6 + _GLIBCXX_NUM_CATEGORIES; + enum { _S_categories_size = 6 + _GLIBCXX_NUM_CATEGORIES }; #ifdef __GTHREADS static __gthread_once_t _S_once; diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index fdc62b4..5b05f28 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -1,6 +1,6 @@ // Iostreams base classes -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -38,38 +38,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // XXX GLIBCXX_ABI Deprecated - // Definitions for static const data members of __ios_flags. - const __ios_flags::__int_type __ios_flags::_S_boolalpha; - const __ios_flags::__int_type __ios_flags::_S_dec; - const __ios_flags::__int_type __ios_flags::_S_fixed; - const __ios_flags::__int_type __ios_flags::_S_hex; - const __ios_flags::__int_type __ios_flags::_S_internal; - const __ios_flags::__int_type __ios_flags::_S_left; - const __ios_flags::__int_type __ios_flags::_S_oct; - const __ios_flags::__int_type __ios_flags::_S_right; - const __ios_flags::__int_type __ios_flags::_S_scientific; - const __ios_flags::__int_type __ios_flags::_S_showbase; - const __ios_flags::__int_type __ios_flags::_S_showpoint; - const __ios_flags::__int_type __ios_flags::_S_showpos; - const __ios_flags::__int_type __ios_flags::_S_skipws; - const __ios_flags::__int_type __ios_flags::_S_unitbuf; - const __ios_flags::__int_type __ios_flags::_S_uppercase; - const __ios_flags::__int_type __ios_flags::_S_adjustfield; - const __ios_flags::__int_type __ios_flags::_S_basefield; - const __ios_flags::__int_type __ios_flags::_S_floatfield; - - const __ios_flags::__int_type __ios_flags::_S_badbit; - const __ios_flags::__int_type __ios_flags::_S_eofbit; - const __ios_flags::__int_type __ios_flags::_S_failbit; - - const __ios_flags::__int_type __ios_flags::_S_app; - const __ios_flags::__int_type __ios_flags::_S_ate; - const __ios_flags::__int_type __ios_flags::_S_bin; - const __ios_flags::__int_type __ios_flags::_S_in; - const __ios_flags::__int_type __ios_flags::_S_out; - const __ios_flags::__int_type __ios_flags::_S_trunc; - // Definitions for static const members of ios_base. const ios_base::fmtflags ios_base::boolalpha; const ios_base::fmtflags ios_base::dec; @@ -106,8 +74,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const ios_base::seekdir ios_base::cur; const ios_base::seekdir ios_base::end; - const int ios_base::_S_local_word_size; - _Atomic_word ios_base::Init::_S_refcount; bool ios_base::Init::_S_synced_with_stdio = true; diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index 7f54ab8..c56ec51 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -71,7 +71,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // These are no longer exported. locale::_Impl* locale::_S_classic; locale::_Impl* locale::_S_global; - const size_t locale::_S_categories_size; #ifdef __GTHREADS __gthread_once_t locale::_S_once = __GTHREAD_ONCE_INIT; -- 2.7.4