[libcxx-commits] [libcxx] 2a0f2fa - [libc++] Use inline instead of static in headers.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Sep 10 09:54:47 PDT 2023
Author: Mark de Wever
Date: 2023-09-10T18:54:06+02:00
New Revision: 2a0f2fa9d1b6c2b4faf2121a22204a1dd7cf487d
URL: https://github.com/llvm/llvm-project/commit/2a0f2fa9d1b6c2b4faf2121a22204a1dd7cf487d
DIFF: https://github.com/llvm/llvm-project/commit/2a0f2fa9d1b6c2b4faf2121a22204a1dd7cf487d.diff
LOG: [libc++] Use inline instead of static in headers.
This has been tested as part of D156609.
Added:
Modified:
libcxx/src/std_stream.h
Removed:
################################################################################
diff --git a/libcxx/src/std_stream.h b/libcxx/src/std_stream.h
index 0febf42c9fff3fd..37b4ffd1b4f6c51 100644
--- a/libcxx/src/std_stream.h
+++ b/libcxx/src/std_stream.h
@@ -113,7 +113,7 @@ __stdinbuf<_CharT>::uflow()
return __getchar(true);
}
-static bool __do_getc(FILE *__fp, char *__pbuf) {
+inline bool __do_getc(FILE *__fp, char *__pbuf) {
int __c = getc(__fp);
if (__c == EOF)
return false;
@@ -121,7 +121,7 @@ static bool __do_getc(FILE *__fp, char *__pbuf) {
return true;
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-static bool __do_getc(FILE *__fp, wchar_t *__pbuf) {
+inline bool __do_getc(FILE *__fp, wchar_t *__pbuf) {
wint_t __c = getwc(__fp);
if (__c == WEOF)
return false;
@@ -130,13 +130,13 @@ static bool __do_getc(FILE *__fp, wchar_t *__pbuf) {
}
#endif
-static bool __do_ungetc(int __c, FILE *__fp, char __dummy) {
+inline bool __do_ungetc(int __c, FILE *__fp, char __dummy) {
if (ungetc(__c, __fp) == EOF)
return false;
return true;
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-static bool __do_ungetc(std::wint_t __c, FILE *__fp, wchar_t __dummy) {
+inline bool __do_ungetc(std::wint_t __c, FILE *__fp, wchar_t __dummy) {
if (ungetwc(__c, __fp) == WEOF)
return false;
return true;
@@ -324,13 +324,13 @@ __stdoutbuf<_CharT>::__stdoutbuf(FILE* __fp, state_type* __st)
__always_noconv_ = true;
}
-static bool __do_fputc(char __c, FILE* __fp) {
+inline bool __do_fputc(char __c, FILE* __fp) {
if (fwrite(&__c, sizeof(__c), 1, __fp) != 1)
return false;
return true;
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-static bool __do_fputc(wchar_t __c, FILE* __fp) {
+inline bool __do_fputc(wchar_t __c, FILE* __fp) {
// fputwc works regardless of wide/narrow mode of stdout, while
// fwrite of wchar_t only works if the stream actually has been set
// into wide mode.
More information about the libcxx-commits
mailing list