[libcxx-commits] [libcxx] 52e9d80 - [libc++] add `inline` for __open's definition in ifstream and ofstream
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Apr 12 12:26:05 PDT 2021
Author: jasonliu
Date: 2021-04-12T19:25:49Z
New Revision: 52e9d80d5db20f23979e409f958736d130387f9e
URL: https://github.com/llvm/llvm-project/commit/52e9d80d5db20f23979e409f958736d130387f9e
DIFF: https://github.com/llvm/llvm-project/commit/52e9d80d5db20f23979e409f958736d130387f9e.diff
LOG: [libc++] add `inline` for __open's definition in ifstream and ofstream
Summary:
When building with gcc on AIX, it seems that gcc does not like the
`always_inline` without the `inline` keyword.
So adding the inline keywords in for __open in ifstream and ofstream.
That will also make it consistent with __open in basic_filebuf
(it seems we added `inline` there before for gcc build as well).
Differential Revision: https://reviews.llvm.org/D99422
Added:
Modified:
libcxx/include/fstream
Removed:
################################################################################
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index 51b26ecf79e4..912936594cf1 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -247,7 +247,7 @@ public:
return open(__p.c_str(), __mode);
}
#endif
- inline _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY
basic_filebuf* __open(int __fd, ios_base::openmode __mode);
#endif
basic_filebuf* close();
@@ -577,7 +577,7 @@ basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_filebuf<_CharT, _Traits>*
basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {
basic_filebuf<_CharT, _Traits>* __rt = nullptr;
@@ -1329,6 +1329,7 @@ basic_ifstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mo
}
template <class _CharT, class _Traits>
+inline
void basic_ifstream<_CharT, _Traits>::__open(int __fd,
ios_base::openmode __mode) {
if (__sb_.__open(__fd, __mode | ios_base::in))
@@ -1542,6 +1543,7 @@ basic_ofstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mo
}
template <class _CharT, class _Traits>
+inline
void basic_ofstream<_CharT, _Traits>::__open(int __fd,
ios_base::openmode __mode) {
if (__sb_.__open(__fd, __mode | ios_base::out))
More information about the libcxx-commits
mailing list