Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions libc/src/stdio/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ add_entrypoint_object(
DEPENDS
libc.hdr.types.FILE
libc.src.__support.RPC.rpc_client
.gpu_file
)

add_entrypoint_object(
Expand All @@ -70,6 +71,7 @@ add_entrypoint_object(
DEPENDS
libc.hdr.types.FILE
libc.src.__support.RPC.rpc_client
.gpu_file
)

add_entrypoint_object(
Expand Down Expand Up @@ -114,6 +116,7 @@ add_entrypoint_object(
DEPENDS
libc.hdr.types.FILE
libc.src.__support.RPC.rpc_client
.gpu_file
)

add_entrypoint_object(
Expand All @@ -124,6 +127,7 @@ add_entrypoint_object(
../fopen.h
DEPENDS
libc.hdr.types.FILE
.gpu_file
)

add_entrypoint_object(
Expand All @@ -134,6 +138,8 @@ add_entrypoint_object(
../fclose.h
DEPENDS
libc.hdr.types.FILE
libc.hdr.stdio_macros
.gpu_file
)

add_entrypoint_object(
Expand All @@ -144,6 +150,7 @@ add_entrypoint_object(
../fread.h
DEPENDS
libc.hdr.types.FILE
.gpu_file
)

add_entrypoint_object(
Expand Down Expand Up @@ -254,8 +261,6 @@ add_entrypoint_object(
DEPENDS
libc.hdr.types.FILE
.gpu_file
.feof
.ferror
)

add_entrypoint_object(
Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/clearerr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/clearerr.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/fclose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fclose.h"
#include "src/__support/macros/config.h"
#include "src/stdio/gpu/file.h"

#include "hdr/stdio_macros.h"
#include "hdr/types/FILE.h"
#include "src/__support/common.h"
#include "src/stdio/gpu/file.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/feof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/feof.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/ferror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/ferror.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/fflush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fflush.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/fgetc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fgetc.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/stdio_macros.h" // for EOF.
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
9 changes: 4 additions & 5 deletions libc/src/stdio/gpu/fgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fgets.h"
#include "file.h"
#include "src/__support/macros/config.h"
#include "src/stdio/feof.h"
#include "src/stdio/ferror.h"

#include "file.h"
#include "hdr/stdio_macros.h" // for EOF.
#include "hdr/types/FILE.h"
#include <stddef.h>
#include "src/__support/common.h"

#include <stdint.h>

namespace LIBC_NAMESPACE_DECL {

Expand Down
7 changes: 2 additions & 5 deletions libc/src/stdio/gpu/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
//
//===----------------------------------------------------------------------===//

#include "hdr/stdio_macros.h" // For stdin/out/err
#include "hdr/types/FILE.h"
#include "src/__support/RPC/rpc_client.h"
#include "src/__support/common.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include "src/string/string_utils.h"

#include "hdr/stdio_macros.h" // For stdin/out/err
#include "hdr/types/FILE.h"

namespace LIBC_NAMESPACE_DECL {
namespace file {
Expand Down
6 changes: 3 additions & 3 deletions libc/src/stdio/gpu/fopen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fopen.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/macros/config.h"
#include "src/stdio/gpu/file.h"

#include "hdr/types/FILE.h"
#include "src/__support/common.h"
#include "src/stdio/gpu/file.h"
#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
1 change: 1 addition & 0 deletions libc/src/stdio/gpu/fprintf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "hdr/types/FILE.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/arg_list.h"
#include "src/__support/common.h"
#include "src/errno/libc_errno.h"
#include "src/stdio/gpu/vfprintf_utils.h"

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/fputc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fputc.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/stdio_macros.h" // for EOF.
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
7 changes: 3 additions & 4 deletions libc/src/stdio/gpu/fputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fputs.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/stdio/gpu/file.h"

#include "hdr/stdio_macros.h" // for EOF.
#include "hdr/types/FILE.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/common.h"
#include "src/stdio/gpu/file.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/fread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fread.h"
#include "src/__support/macros/config.h"
#include "src/stdio/gpu/file.h"

#include "hdr/types/FILE.h"
#include "src/__support/common.h"
#include "src/stdio/gpu/file.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/fseek.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fseek.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/ftell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/ftell.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/fwrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/fwrite.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/getc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/getc.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/stdio_macros.h" // for EOF.
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/getchar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/getchar.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/stdio_macros.h" // for EOF and stdin.
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
1 change: 1 addition & 0 deletions libc/src/stdio/gpu/printf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "src/__support/CPP/string_view.h"
#include "src/__support/arg_list.h"
#include "src/__support/common.h"
#include "src/errno/libc_errno.h"
#include "src/stdio/gpu/vfprintf_utils.h"

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/putc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/putc.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/stdio_macros.h" // for EOF.
#include "hdr/types/FILE.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/stdio/gpu/putchar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/putchar.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/stdio_macros.h" // for EOF and stdout.
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
11 changes: 5 additions & 6 deletions libc/src/stdio/gpu/puts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/puts.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/stdio/gpu/file.h"

#include "hdr/stdio_macros.h" // for EOF and stdout.
#include "src/__support/CPP/string_view.h"
#include "src/__support/common.h"
#include "src/stdio/gpu/file.h"

namespace LIBC_NAMESPACE_DECL {

LLVM_LIBC_FUNCTION(int, puts, (const char *__restrict str)) {
cpp::string_view str_view(str);
auto written = file::write_impl<LIBC_WRITE_TO_STDOUT_NEWLINE>(stdout, str,
str_view.size());
auto written = file::write_impl<LIBC_WRITE_TO_STDOUT_NEWLINE>(
stdout, str, str_view.size());
if (written != str_view.size() + 1)
return EOF;
return 0;
Expand Down
5 changes: 3 additions & 2 deletions libc/src/stdio/gpu/remove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/remove.h"
#include "file.h"
#include "src/__support/macros/config.h"

#include "file.h"
#include "hdr/types/FILE.h"
#include "src/__support/common.h"
#include "src/string/string_utils.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
6 changes: 3 additions & 3 deletions libc/src/stdio/gpu/rename.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//

#include "src/stdio/rename.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/macros/config.h"
#include "src/stdio/gpu/file.h"

#include "hdr/types/FILE.h"
#include "src/__support/common.h"
#include "src/stdio/gpu/file.h"
#include "src/string/string_utils.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
Loading
Loading