diff options
author | Michael Jones <michaelrj@google.com> | 2023-07-20 14:47:02 -0700 |
---|---|---|
committer | Michael Jones <michaelrj@google.com> | 2023-07-20 14:50:18 -0700 |
commit | aeec4627e6df467ecb37367d6fbb140d6c9c2e10 (patch) | |
tree | d417682e54584ea9cc7a5869b175f800373059f6 /libc | |
parent | 37e5baf318b1248c189ccc9558f3beb7af736885 (diff) | |
download | llvm-aeec4627e6df467ecb37367d6fbb140d6c9c2e10.zip llvm-aeec4627e6df467ecb37367d6fbb140d6c9c2e10.tar.gz llvm-aeec4627e6df467ecb37367d6fbb140d6c9c2e10.tar.bz2 |
[libc][NFC] mark vprintf functions as inline
The functions are in a header, and so must be marked inline to avoid
symbol conflicts.
Differential Revision: https://reviews.llvm.org/D155892
Diffstat (limited to 'libc')
-rw-r--r-- | libc/src/stdio/printf_core/vfprintf_internal.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/src/stdio/printf_core/vfprintf_internal.h b/libc/src/stdio/printf_core/vfprintf_internal.h index 198213c..e45189d 100644 --- a/libc/src/stdio/printf_core/vfprintf_internal.h +++ b/libc/src/stdio/printf_core/vfprintf_internal.h @@ -55,7 +55,7 @@ LIBC_INLINE int fwrite_unlocked(const void *ptr, size_t size, size_t nmemb, namespace printf_core { -int file_write_hook(cpp::string_view new_str, void *fp) { +LIBC_INLINE int file_write_hook(cpp::string_view new_str, void *fp) { ::FILE *target_file = reinterpret_cast<::FILE *>(fp); // Write new_str to the target file. The logic preventing a zero-length write // is in the writer, so we don't check here. @@ -66,8 +66,9 @@ int file_write_hook(cpp::string_view new_str, void *fp) { return WRITE_OK; } -int vfprintf_internal(::FILE *__restrict stream, const char *__restrict format, - internal::ArgList &args) { +LIBC_INLINE int vfprintf_internal(::FILE *__restrict stream, + const char *__restrict format, + internal::ArgList &args) { constexpr size_t BUFF_SIZE = 1024; char buffer[BUFF_SIZE]; printf_core::WriteBuffer wb(buffer, BUFF_SIZE, &file_write_hook, |