Skip to content

Commit 2a0f2fa

Browse files
committed
[libc++] Use inline instead of static in headers.
This has been tested as part of D156609.
1 parent 7ad5b18 commit 2a0f2fa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libcxx/src/std_stream.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ __stdinbuf<_CharT>::uflow()
113113
return __getchar(true);
114114
}
115115

116-
static bool __do_getc(FILE *__fp, char *__pbuf) {
116+
inline bool __do_getc(FILE *__fp, char *__pbuf) {
117117
int __c = getc(__fp);
118118
if (__c == EOF)
119119
return false;
120120
*__pbuf = static_cast<char>(__c);
121121
return true;
122122
}
123123
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
124-
static bool __do_getc(FILE *__fp, wchar_t *__pbuf) {
124+
inline bool __do_getc(FILE *__fp, wchar_t *__pbuf) {
125125
wint_t __c = getwc(__fp);
126126
if (__c == WEOF)
127127
return false;
@@ -130,13 +130,13 @@ static bool __do_getc(FILE *__fp, wchar_t *__pbuf) {
130130
}
131131
#endif
132132

133-
static bool __do_ungetc(int __c, FILE *__fp, char __dummy) {
133+
inline bool __do_ungetc(int __c, FILE *__fp, char __dummy) {
134134
if (ungetc(__c, __fp) == EOF)
135135
return false;
136136
return true;
137137
}
138138
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
139-
static bool __do_ungetc(std::wint_t __c, FILE *__fp, wchar_t __dummy) {
139+
inline bool __do_ungetc(std::wint_t __c, FILE *__fp, wchar_t __dummy) {
140140
if (ungetwc(__c, __fp) == WEOF)
141141
return false;
142142
return true;
@@ -324,13 +324,13 @@ __stdoutbuf<_CharT>::__stdoutbuf(FILE* __fp, state_type* __st)
324324
__always_noconv_ = true;
325325
}
326326

327-
static bool __do_fputc(char __c, FILE* __fp) {
327+
inline bool __do_fputc(char __c, FILE* __fp) {
328328
if (fwrite(&__c, sizeof(__c), 1, __fp) != 1)
329329
return false;
330330
return true;
331331
}
332332
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
333-
static bool __do_fputc(wchar_t __c, FILE* __fp) {
333+
inline bool __do_fputc(wchar_t __c, FILE* __fp) {
334334
// fputwc works regardless of wide/narrow mode of stdout, while
335335
// fwrite of wchar_t only works if the stream actually has been set
336336
// into wide mode.

0 commit comments

Comments
 (0)