aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/std_fstream.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/std/std_fstream.h')
-rw-r--r--libstdc++-v3/include/std/std_fstream.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h
index ed119d4c8ea..c7a934be9f0 100644
--- a/libstdc++-v3/include/std/std_fstream.h
+++ b/libstdc++-v3/include/std/std_fstream.h
@@ -414,7 +414,8 @@ namespace std
typedef basic_istream<char_type, traits_type> __istream_type;
private:
- __filebuf_type _M_filebuf;
+ /* APPLE LOCAL work with -malign-natural. */
+ __filebuf_type _M_filebuf __attribute((aligned(8)));
public:
// Constructors/Destructors:
@@ -496,6 +497,10 @@ namespace std
{
if (!_M_filebuf.open(__s, __mode | ios_base::in))
this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
}
/**
@@ -538,7 +543,8 @@ namespace std
typedef basic_ostream<char_type, traits_type> __ostream_type;
private:
- __filebuf_type _M_filebuf;
+ /* APPLE LOCAL work with -malign-natural. */
+ __filebuf_type _M_filebuf __attribute__((aligned(8)));
public:
// Constructors:
@@ -623,6 +629,10 @@ namespace std
{
if (!_M_filebuf.open(__s, __mode | ios_base::out))
this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
}
/**
@@ -749,6 +759,10 @@ namespace std
{
if (!_M_filebuf.open(__s, __mode))
this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
}
/**