File tree Expand file tree Collapse file tree 4 files changed +66
-0
lines changed Expand file tree Collapse file tree 4 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -968,6 +968,13 @@ def StdC : StandardSpec<"stdc"> {
968968 RetValSpec<IntType>,
969969 [ArgSpec<IntType>, ArgSpec<FILEPtr>]
970970 >,
971+ FunctionSpec<
972+ "vasprintf",
973+ RetValSpec<IntType>,
974+ [ArgSpec<CharRestrictedPtrPtr>,
975+ ArgSpec<ConstCharPtr>,
976+ ArgSpec<VaListType>]
977+ >,
971978 ],
972979 [
973980 ObjectSpec<
Original file line number Diff line number Diff line change @@ -203,6 +203,16 @@ add_entrypoint_object(
203203 libc.src.stdio.printf_core.vfprintf_internal
204204)
205205
206+ add_entrypoint_object(
207+ vasprintf
208+ SRCS
209+ vasprintf.cpp
210+ HDRS
211+ vasprintf.h
212+ DEPENDS
213+ libc.src.__support.arg_list
214+ )
215+
206216add_stdio_entrypoint_object(
207217 fileno
208218 SRCS
Original file line number Diff line number Diff line change 1+ // ===-- Implementation of vasprintf -----------------------------*- C++ -*-===//
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/vasprintf.h"
10+
11+ #include " src/__support/arg_list.h"
12+
13+ #include < stdarg.h>
14+ #include < stdio.h>
15+
16+ namespace LIBC_NAMESPACE {
17+
18+ LLVM_LIBC_FUNCTION (int , vasprintf,
19+ (char **__restrict, const char *,
20+ va_list vlist)) {
21+ internal::ArgList args (vlist); // This holder class allows for easier copying
22+ // and pointer semantics, as well as handling
23+ // destruction automatically.
24+ return -1 ;
25+ }
26+
27+ } // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change 1+ // ===-- Implementation header of vasprintf ----------------------*- C++ -*-===//
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+ #ifndef LLVM_LIBC_SRC_STDIO_VASPRINTF_H
10+ #define LLVM_LIBC_SRC_STDIO_VASPRINTF_H
11+
12+ #include < stdarg.h>
13+ #include < stdio.h>
14+
15+ namespace LIBC_NAMESPACE {
16+
17+ int vasprintf (char **__restrict s, const char * format,
18+ va_list vlist);
19+
20+ } // namespace LIBC_NAMESPACE
21+
22+ #endif // LLVM_LIBC_SRC_STDIO_VASPRINTF_H
You can’t perform that action at this time.
0 commit comments