xref: /llvm-project/libc/src/stdio/gpu/vprintf.cpp (revision 03dcefe08ecb68a3fedb7e9de6277df77371e9fc)
140effc7aSJoseph Huber //===-- GPU Implementation of vprintf -------------------------------------===//
240effc7aSJoseph Huber //
340effc7aSJoseph Huber // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
440effc7aSJoseph Huber // See https://llvm.org/LICENSE.txt for license information.
540effc7aSJoseph Huber // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
640effc7aSJoseph Huber //
740effc7aSJoseph Huber //===----------------------------------------------------------------------===//
840effc7aSJoseph Huber 
940effc7aSJoseph Huber #include "src/stdio/vprintf.h"
1040effc7aSJoseph Huber 
1140effc7aSJoseph Huber #include "src/__support/CPP/string_view.h"
1240effc7aSJoseph Huber #include "src/__support/arg_list.h"
1340effc7aSJoseph Huber #include "src/errno/libc_errno.h"
1440effc7aSJoseph Huber #include "src/stdio/gpu/vfprintf_utils.h"
1540effc7aSJoseph Huber 
16*03dcefe0SJoseph Huber namespace LIBC_NAMESPACE_DECL {
1740effc7aSJoseph Huber 
1840effc7aSJoseph Huber LLVM_LIBC_FUNCTION(int, vprintf,
1940effc7aSJoseph Huber                    (const char *__restrict format, va_list vlist)) {
2040effc7aSJoseph Huber   cpp::string_view str_view(format);
2140effc7aSJoseph Huber   int ret_val = vfprintf_internal(stdout, format, str_view.size() + 1, vlist);
2240effc7aSJoseph Huber   return ret_val;
2340effc7aSJoseph Huber }
2440effc7aSJoseph Huber 
25*03dcefe0SJoseph Huber } // namespace LIBC_NAMESPACE_DECL
26