File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ set(TARGET_LIBC_ENTRYPOINTS
85
85
# stdio.h entrypoints
86
86
libc.src.stdio.printf
87
87
libc.src.stdio.putchar
88
+ libc.src.stdio.puts
88
89
libc.src.stdio.remove
89
90
libc.src.stdio.snprintf
90
91
libc.src.stdio.sprintf
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ set(TARGET_LIBC_ENTRYPOINTS
81
81
# stdio.h entrypoints
82
82
libc.src.stdio.printf
83
83
libc.src.stdio.putchar
84
+ libc.src.stdio.puts
84
85
libc.src.stdio.remove
85
86
libc.src.stdio.snprintf
86
87
libc.src.stdio.sprintf
Original file line number Diff line number Diff line change @@ -32,6 +32,17 @@ add_entrypoint_object(
32
32
libc.src.__support.CPP.string_view
33
33
)
34
34
35
+ add_entrypoint_object (
36
+ puts
37
+ SRCS
38
+ puts.cpp
39
+ HDRS
40
+ ../puts.h
41
+ DEPENDS
42
+ libc.src.__support.OSUtil.osutil
43
+ libc.src.__support.CPP.string_view
44
+ )
45
+
35
46
add_entrypoint_object (
36
47
vprintf
37
48
SRCS
Original file line number Diff line number Diff line change
1
+ // ===-- Implementation of puts for baremetal-------------------------------===//
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/puts.h"
10
+ #include " src/__support/CPP/string_view.h"
11
+ #include " src/__support/OSUtil/io.h"
12
+
13
+ namespace LIBC_NAMESPACE {
14
+
15
+ LLVM_LIBC_FUNCTION (int , puts, (const char *__restrict str)) {
16
+ cpp::string_view str_view (str);
17
+
18
+ // TODO: Can we combine these to avoid needing two writes?
19
+ write_to_stderr (str_view);
20
+ write_to_stderr (" \n " );
21
+
22
+ return 0 ;
23
+ }
24
+
25
+ } // namespace LIBC_NAMESPACE
You can’t perform that action at this time.
0 commit comments