Skip to content

Commit 0680e2b

Browse files
jasonliudevtstellar
authored andcommitted
[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 (cherry picked from commit 52e9d80)
1 parent 884040d commit 0680e2b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libcxx/include/fstream

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public:
244244
return open(__p.c_str(), __mode);
245245
}
246246
#endif
247-
inline _LIBCPP_INLINE_VISIBILITY
247+
_LIBCPP_INLINE_VISIBILITY
248248
basic_filebuf* __open(int __fd, ios_base::openmode __mode);
249249
#endif
250250
basic_filebuf* close();
@@ -574,7 +574,7 @@ basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)
574574
}
575575

576576
template <class _CharT, class _Traits>
577-
inline _LIBCPP_INLINE_VISIBILITY
577+
inline
578578
basic_filebuf<_CharT, _Traits>*
579579
basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {
580580
basic_filebuf<_CharT, _Traits>* __rt = nullptr;
@@ -1326,6 +1326,7 @@ basic_ifstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mo
13261326
}
13271327

13281328
template <class _CharT, class _Traits>
1329+
inline
13291330
void basic_ifstream<_CharT, _Traits>::__open(int __fd,
13301331
ios_base::openmode __mode) {
13311332
if (__sb_.__open(__fd, __mode | ios_base::in))
@@ -1539,6 +1540,7 @@ basic_ofstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mo
15391540
}
15401541

15411542
template <class _CharT, class _Traits>
1543+
inline
15421544
void basic_ofstream<_CharT, _Traits>::__open(int __fd,
15431545
ios_base::openmode __mode) {
15441546
if (__sb_.__open(__fd, __mode | ios_base::out))

0 commit comments

Comments
 (0)