diff options
Diffstat (limited to 'libc/src/__support/File/linux')
| -rw-r--r-- | libc/src/__support/File/linux/dir.cpp | 5 | ||||
| -rw-r--r-- | libc/src/__support/File/linux/file.cpp | 7 | ||||
| -rw-r--r-- | libc/src/__support/File/linux/file.h | 5 | ||||
| -rw-r--r-- | libc/src/__support/File/linux/lseekImpl.h | 5 | ||||
| -rw-r--r-- | libc/src/__support/File/linux/stderr.cpp | 5 | ||||
| -rw-r--r-- | libc/src/__support/File/linux/stdin.cpp | 5 | ||||
| -rw-r--r-- | libc/src/__support/File/linux/stdout.cpp | 5 |
7 files changed, 22 insertions, 15 deletions
diff --git a/libc/src/__support/File/linux/dir.cpp b/libc/src/__support/File/linux/dir.cpp index cae545a9fb8e..fc90ff097e46 100644 --- a/libc/src/__support/File/linux/dir.cpp +++ b/libc/src/__support/File/linux/dir.cpp @@ -10,11 +10,12 @@ #include "src/__support/OSUtil/syscall.h" // For internal syscall function. #include "src/__support/error_or.h" +#include "src/__support/macros/config.h" #include <fcntl.h> // For open flags #include <sys/syscall.h> // For syscall numbers -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { ErrorOr<int> platform_opendir(const char *name) { int open_flags = O_RDONLY | O_DIRECTORY | O_CLOEXEC; @@ -56,4 +57,4 @@ int platform_closedir(int fd) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/__support/File/linux/file.cpp b/libc/src/__support/File/linux/file.cpp index df68570bc104..22292336f300 100644 --- a/libc/src/__support/File/linux/file.cpp +++ b/libc/src/__support/File/linux/file.cpp @@ -15,13 +15,14 @@ #include "src/__support/File/linux/lseekImpl.h" #include "src/__support/OSUtil/fcntl.h" #include "src/__support/OSUtil/syscall.h" // For internal syscall function. -#include "src/errno/libc_errno.h" // For error macros +#include "src/__support/macros/config.h" +#include "src/errno/libc_errno.h" // For error macros #include <fcntl.h> // For mode_t and other flags to the open syscall #include <sys/stat.h> // For S_IS*, S_IF*, and S_IR* flags. #include <sys/syscall.h> // For syscall numbers -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { FileIOResult linux_file_write(File *f, const void *data, size_t size) { auto *lf = reinterpret_cast<LinuxFile *>(f); @@ -179,4 +180,4 @@ int get_fileno(File *f) { return lf->get_fd(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/__support/File/linux/file.h b/libc/src/__support/File/linux/file.h index 0507109e6793..16d72a60f863 100644 --- a/libc/src/__support/File/linux/file.h +++ b/libc/src/__support/File/linux/file.h @@ -8,8 +8,9 @@ #include "hdr/types/off_t.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { FileIOResult linux_file_write(File *, const void *, size_t); FileIOResult linux_file_read(File *, void *, size_t); @@ -33,4 +34,4 @@ public: // Create a File object and associate it with a fd. ErrorOr<LinuxFile *> create_file_from_fd(int fd, const char *mode); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/__support/File/linux/lseekImpl.h b/libc/src/__support/File/linux/lseekImpl.h index af015a2fd6a7..a034913d9f6e 100644 --- a/libc/src/__support/File/linux/lseekImpl.h +++ b/libc/src/__support/File/linux/lseekImpl.h @@ -13,12 +13,13 @@ #include "src/__support/OSUtil/syscall.h" // For internal syscall function. #include "src/__support/common.h" #include "src/__support/error_or.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stdint.h> // For uint64_t. #include <sys/syscall.h> // For syscall numbers. -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace internal { LIBC_INLINE ErrorOr<off_t> lseekimpl(int fd, off_t offset, int whence) { @@ -45,6 +46,6 @@ LIBC_INLINE ErrorOr<off_t> lseekimpl(int fd, off_t offset, int whence) { } } // namespace internal -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC___SUPPORT_FILE_LINUX_LSEEKIMPL_H diff --git a/libc/src/__support/File/linux/stderr.cpp b/libc/src/__support/File/linux/stderr.cpp index 0b4b207329ff..bc174792856e 100644 --- a/libc/src/__support/File/linux/stderr.cpp +++ b/libc/src/__support/File/linux/stderr.cpp @@ -9,15 +9,16 @@ #include "file.h" #include "hdr/stdio_macros.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { constexpr size_t STDERR_BUFFER_SIZE = 0; static LinuxFile StdErr(2, nullptr, STDERR_BUFFER_SIZE, _IONBF, false, File::ModeFlags(File::OpenMode::APPEND)); File *stderr = &StdErr; -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL extern "C" { FILE *stderr = reinterpret_cast<FILE *>(&LIBC_NAMESPACE::StdErr); diff --git a/libc/src/__support/File/linux/stdin.cpp b/libc/src/__support/File/linux/stdin.cpp index 49146dacfd4a..e7b6ede85dde 100644 --- a/libc/src/__support/File/linux/stdin.cpp +++ b/libc/src/__support/File/linux/stdin.cpp @@ -9,8 +9,9 @@ #include "file.h" #include "hdr/stdio_macros.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { constexpr size_t STDIN_BUFFER_SIZE = 512; uint8_t stdin_buffer[STDIN_BUFFER_SIZE]; @@ -18,7 +19,7 @@ static LinuxFile StdIn(0, stdin_buffer, STDIN_BUFFER_SIZE, _IOFBF, false, File::ModeFlags(File::OpenMode::READ)); File *stdin = &StdIn; -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL extern "C" { FILE *stdin = reinterpret_cast<FILE *>(&LIBC_NAMESPACE::StdIn); diff --git a/libc/src/__support/File/linux/stdout.cpp b/libc/src/__support/File/linux/stdout.cpp index 58caf85b5167..0d3b9f3d0376 100644 --- a/libc/src/__support/File/linux/stdout.cpp +++ b/libc/src/__support/File/linux/stdout.cpp @@ -9,8 +9,9 @@ #include "file.h" #include "hdr/stdio_macros.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { constexpr size_t STDOUT_BUFFER_SIZE = 1024; uint8_t stdout_buffer[STDOUT_BUFFER_SIZE]; @@ -18,7 +19,7 @@ static LinuxFile StdOut(1, stdout_buffer, STDOUT_BUFFER_SIZE, _IOLBF, false, File::ModeFlags(File::OpenMode::APPEND)); File *stdout = &StdOut; -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL extern "C" { FILE *stdout = reinterpret_cast<FILE *>(&LIBC_NAMESPACE::StdOut); |
