xref: /aosp_15_r20/external/llvm-libc/src/stdio/gpu/vprintf.cpp (revision 71db0c75aadcf003ffe3238005f61d7618a3fead)
1 //===-- GPU Implementation of vprintf -------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "src/stdio/vprintf.h"
10 
11 #include "src/__support/CPP/string_view.h"
12 #include "src/__support/arg_list.h"
13 #include "src/errno/libc_errno.h"
14 #include "src/stdio/gpu/vfprintf_utils.h"
15 
16 namespace LIBC_NAMESPACE_DECL {
17 
18 LLVM_LIBC_FUNCTION(int, vprintf,
19                    (const char *__restrict format, va_list vlist)) {
20   cpp::string_view str_view(format);
21   int ret_val = vfprintf_internal(stdout, format, str_view.size() + 1, vlist);
22   return ret_val;
23 }
24 
25 } // namespace LIBC_NAMESPACE_DECL
26