1 //===-- Implementation of vasprintf -----------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #include "src/stdio/vasprintf.h"
10 #include "src/__support/arg_list.h"
11 #include "src/stdio/printf_core/vasprintf_internal.h"
13 namespace LIBC_NAMESPACE_DECL
{
15 LLVM_LIBC_FUNCTION(int, vasprintf
,
16 (char **__restrict ret
, const char *__restrict format
,
18 internal::ArgList
args(vlist
); // This holder class allows for easier copying
19 // and pointer semantics, as well as handling
20 // destruction automatically.
21 return printf_core::vasprintf_internal(ret
, format
, args
);
24 } // namespace LIBC_NAMESPACE_DECL