summaryrefslogtreecommitdiff
path: root/libc/src/unistd
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/unistd')
-rw-r--r--libc/src/unistd/_exit.cpp5
-rw-r--r--libc/src/unistd/_exit.h6
-rw-r--r--libc/src/unistd/access.h6
-rw-r--r--libc/src/unistd/chdir.h6
-rw-r--r--libc/src/unistd/close.h6
-rw-r--r--libc/src/unistd/dup.h5
-rw-r--r--libc/src/unistd/dup2.h5
-rw-r--r--libc/src/unistd/dup3.h5
-rw-r--r--libc/src/unistd/environ.cpp6
-rw-r--r--libc/src/unistd/environ.h6
-rw-r--r--libc/src/unistd/execv.h6
-rw-r--r--libc/src/unistd/execve.h6
-rw-r--r--libc/src/unistd/fchdir.h6
-rw-r--r--libc/src/unistd/fork.h5
-rw-r--r--libc/src/unistd/fpathconf.h6
-rw-r--r--libc/src/unistd/fsync.h6
-rw-r--r--libc/src/unistd/ftruncate.h5
-rw-r--r--libc/src/unistd/getcwd.h5
-rw-r--r--libc/src/unistd/geteuid.h5
-rw-r--r--libc/src/unistd/getopt.cpp5
-rw-r--r--libc/src/unistd/getopt.h5
-rw-r--r--libc/src/unistd/getpid.h5
-rw-r--r--libc/src/unistd/getppid.h5
-rw-r--r--libc/src/unistd/getuid.h5
-rw-r--r--libc/src/unistd/isatty.h5
-rw-r--r--libc/src/unistd/link.h5
-rw-r--r--libc/src/unistd/linkat.h6
-rw-r--r--libc/src/unistd/linux/access.cpp5
-rw-r--r--libc/src/unistd/linux/chdir.cpp5
-rw-r--r--libc/src/unistd/linux/close.cpp5
-rw-r--r--libc/src/unistd/linux/dup.cpp5
-rw-r--r--libc/src/unistd/linux/dup2.cpp5
-rw-r--r--libc/src/unistd/linux/dup3.cpp5
-rw-r--r--libc/src/unistd/linux/execv.cpp5
-rw-r--r--libc/src/unistd/linux/execve.cpp5
-rw-r--r--libc/src/unistd/linux/fchdir.cpp5
-rw-r--r--libc/src/unistd/linux/fork.cpp5
-rw-r--r--libc/src/unistd/linux/fpathconf.cpp5
-rw-r--r--libc/src/unistd/linux/fsync.cpp5
-rw-r--r--libc/src/unistd/linux/ftruncate.cpp5
-rw-r--r--libc/src/unistd/linux/getcwd.cpp5
-rw-r--r--libc/src/unistd/linux/geteuid.cpp5
-rw-r--r--libc/src/unistd/linux/getpid.cpp5
-rw-r--r--libc/src/unistd/linux/getppid.cpp5
-rw-r--r--libc/src/unistd/linux/getuid.cpp5
-rw-r--r--libc/src/unistd/linux/isatty.cpp5
-rw-r--r--libc/src/unistd/linux/link.cpp5
-rw-r--r--libc/src/unistd/linux/linkat.cpp5
-rw-r--r--libc/src/unistd/linux/lseek.cpp5
-rw-r--r--libc/src/unistd/linux/pathconf.cpp5
-rw-r--r--libc/src/unistd/linux/pathconf_utils.cpp5
-rw-r--r--libc/src/unistd/linux/pathconf_utils.h5
-rw-r--r--libc/src/unistd/linux/pipe.cpp5
-rw-r--r--libc/src/unistd/linux/pread.cpp5
-rw-r--r--libc/src/unistd/linux/pwrite.cpp5
-rw-r--r--libc/src/unistd/linux/read.cpp5
-rw-r--r--libc/src/unistd/linux/readlink.cpp5
-rw-r--r--libc/src/unistd/linux/readlinkat.cpp5
-rw-r--r--libc/src/unistd/linux/rmdir.cpp5
-rw-r--r--libc/src/unistd/linux/symlink.cpp5
-rw-r--r--libc/src/unistd/linux/symlinkat.cpp5
-rw-r--r--libc/src/unistd/linux/syscall.cpp5
-rw-r--r--libc/src/unistd/linux/sysconf.cpp5
-rw-r--r--libc/src/unistd/linux/truncate.cpp5
-rw-r--r--libc/src/unistd/linux/unlink.cpp5
-rw-r--r--libc/src/unistd/linux/unlinkat.cpp5
-rw-r--r--libc/src/unistd/linux/write.cpp5
-rw-r--r--libc/src/unistd/lseek.h5
-rw-r--r--libc/src/unistd/pathconf.h6
-rw-r--r--libc/src/unistd/pipe.h6
-rw-r--r--libc/src/unistd/pread.h5
-rw-r--r--libc/src/unistd/pwrite.h5
-rw-r--r--libc/src/unistd/read.h5
-rw-r--r--libc/src/unistd/readlink.h5
-rw-r--r--libc/src/unistd/readlinkat.h5
-rw-r--r--libc/src/unistd/rmdir.h6
-rw-r--r--libc/src/unistd/swab.cpp5
-rw-r--r--libc/src/unistd/swab.h5
-rw-r--r--libc/src/unistd/symlink.h5
-rw-r--r--libc/src/unistd/symlinkat.h5
-rw-r--r--libc/src/unistd/syscall.h5
-rw-r--r--libc/src/unistd/sysconf.h5
-rw-r--r--libc/src/unistd/truncate.h5
-rw-r--r--libc/src/unistd/unlink.h6
-rw-r--r--libc/src/unistd/unlinkat.h6
-rw-r--r--libc/src/unistd/write.h5
86 files changed, 275 insertions, 172 deletions
diff --git a/libc/src/unistd/_exit.cpp b/libc/src/unistd/_exit.cpp
index 4b652a2c13fd..854bf8b8a0c3 100644
--- a/libc/src/unistd/_exit.cpp
+++ b/libc/src/unistd/_exit.cpp
@@ -9,11 +9,12 @@
#include "src/unistd/_exit.h"
#include "src/__support/OSUtil/exit.h"
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
[[noreturn]] LLVM_LIBC_FUNCTION(void, _exit, (int status)) {
internal::exit(status);
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/_exit.h b/libc/src/unistd/_exit.h
index 141b87532189..e00e27cfe253 100644
--- a/libc/src/unistd/_exit.h
+++ b/libc/src/unistd/_exit.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD__EXIT_H
#define LLVM_LIBC_SRC_UNISTD__EXIT_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
[[noreturn]] void _exit(int status);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD__EXIT_H
diff --git a/libc/src/unistd/access.h b/libc/src/unistd/access.h
index 7623c853091f..1471224948e5 100644
--- a/libc/src/unistd/access.h
+++ b/libc/src/unistd/access.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_ACCESS_H
#define LLVM_LIBC_SRC_UNISTD_ACCESS_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int access(const char *path, int mode);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_ACCESS_H
diff --git a/libc/src/unistd/chdir.h b/libc/src/unistd/chdir.h
index ca1dd356b7cf..db2b4dae9db6 100644
--- a/libc/src/unistd/chdir.h
+++ b/libc/src/unistd/chdir.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_CHDIR_H
#define LLVM_LIBC_SRC_UNISTD_CHDIR_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int chdir(const char *path);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_CHDIR_H
diff --git a/libc/src/unistd/close.h b/libc/src/unistd/close.h
index 02e01c24120a..599be831c0e6 100644
--- a/libc/src/unistd/close.h
+++ b/libc/src/unistd/close.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_CLOSE_H
#define LLVM_LIBC_SRC_UNISTD_CLOSE_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int close(int fd);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_CLOSE_H
diff --git a/libc/src/unistd/dup.h b/libc/src/unistd/dup.h
index d6daa5a9ad74..63f093c0ee43 100644
--- a/libc/src/unistd/dup.h
+++ b/libc/src/unistd/dup.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_DUP_H
#define LLVM_LIBC_SRC_UNISTD_DUP_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int dup(int fd);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_DUP_H
diff --git a/libc/src/unistd/dup2.h b/libc/src/unistd/dup2.h
index ba8c5f4b1601..060c112daf08 100644
--- a/libc/src/unistd/dup2.h
+++ b/libc/src/unistd/dup2.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_DUP2_H
#define LLVM_LIBC_SRC_UNISTD_DUP2_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int dup2(int oldfd, int newfd);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_DUP2_H
diff --git a/libc/src/unistd/dup3.h b/libc/src/unistd/dup3.h
index 2b1082403daf..f3868867123b 100644
--- a/libc/src/unistd/dup3.h
+++ b/libc/src/unistd/dup3.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_DUP3_H
#define LLVM_LIBC_SRC_UNISTD_DUP3_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int dup3(int oldfd, int newfd, int flags);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_DUP3_H
diff --git a/libc/src/unistd/environ.cpp b/libc/src/unistd/environ.cpp
index 2266c7203273..db7faef63e0a 100644
--- a/libc/src/unistd/environ.cpp
+++ b/libc/src/unistd/environ.cpp
@@ -6,11 +6,13 @@
//
//===----------------------------------------------------------------------===//
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
// This is initialized to the correct value by the statup code.
extern "C" {
char **environ = nullptr;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/environ.h b/libc/src/unistd/environ.h
index c09a04f99f88..af989675216c 100644
--- a/libc/src/unistd/environ.h
+++ b/libc/src/unistd/environ.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_ENVIRON_H
#define LLVM_LIBC_SRC_UNISTD_ENVIRON_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
extern "C" char **environ;
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_ENVIRON_H
diff --git a/libc/src/unistd/execv.h b/libc/src/unistd/execv.h
index 7ff366464b4c..86bf99978af4 100644
--- a/libc/src/unistd/execv.h
+++ b/libc/src/unistd/execv.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_EXECV_H
#define LLVM_LIBC_SRC_UNISTD_EXECV_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int execv(const char *path, char *const argv[]);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_EXECV_H
diff --git a/libc/src/unistd/execve.h b/libc/src/unistd/execve.h
index 0054a47d4ddd..fe3b93076017 100644
--- a/libc/src/unistd/execve.h
+++ b/libc/src/unistd/execve.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_EXECVE_H
#define LLVM_LIBC_SRC_UNISTD_EXECVE_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int execve(const char *path, char *const argv[], char *const envp[]);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_EXECVE_H
diff --git a/libc/src/unistd/fchdir.h b/libc/src/unistd/fchdir.h
index 267785c919f5..8d1a53bc3f11 100644
--- a/libc/src/unistd/fchdir.h
+++ b/libc/src/unistd/fchdir.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_FCHDIR_H
#define LLVM_LIBC_SRC_UNISTD_FCHDIR_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int fchdir(int fd);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_FCHDIR_H
diff --git a/libc/src/unistd/fork.h b/libc/src/unistd/fork.h
index 6b1b72a7dfc0..b6fd5763b3a5 100644
--- a/libc/src/unistd/fork.h
+++ b/libc/src/unistd/fork.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_FORK_H
#define LLVM_LIBC_SRC_UNISTD_FORK_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
pid_t fork();
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_FORK_H
diff --git a/libc/src/unistd/fpathconf.h b/libc/src/unistd/fpathconf.h
index f3182c812361..610e2429123e 100644
--- a/libc/src/unistd/fpathconf.h
+++ b/libc/src/unistd/fpathconf.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_FPATHCONF_H
#define LLVM_LIBC_SRC_UNISTD_FPATHCONF_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
long fpathconf(int fd, int name);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_FSYNC_H
diff --git a/libc/src/unistd/fsync.h b/libc/src/unistd/fsync.h
index b5742de359d9..5bbf179a9003 100644
--- a/libc/src/unistd/fsync.h
+++ b/libc/src/unistd/fsync.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_FSYNC_H
#define LLVM_LIBC_SRC_UNISTD_FSYNC_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int fsync(int fd);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_FSYNC_H
diff --git a/libc/src/unistd/ftruncate.h b/libc/src/unistd/ftruncate.h
index 5508ef0718e9..cd8d363727c4 100644
--- a/libc/src/unistd/ftruncate.h
+++ b/libc/src/unistd/ftruncate.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_FTRUNCATE_H
#define LLVM_LIBC_SRC_UNISTD_FTRUNCATE_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int ftruncate(int, off_t);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_FTRUNCATE_H
diff --git a/libc/src/unistd/getcwd.h b/libc/src/unistd/getcwd.h
index ab7038e45327..8b63a91c26b5 100644
--- a/libc/src/unistd/getcwd.h
+++ b/libc/src/unistd/getcwd.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_GETCWD_H
#define LLVM_LIBC_SRC_UNISTD_GETCWD_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
char *getcwd(char *buf, size_t size);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_GETCWD_H
diff --git a/libc/src/unistd/geteuid.h b/libc/src/unistd/geteuid.h
index f19cbaefd579..9469797bd3d4 100644
--- a/libc/src/unistd/geteuid.h
+++ b/libc/src/unistd/geteuid.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_GETEUID_H
#define LLVM_LIBC_SRC_UNISTD_GETEUID_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
uid_t geteuid();
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_GETEUID_H
diff --git a/libc/src/unistd/getopt.cpp b/libc/src/unistd/getopt.cpp
index 2a05500b2d74..0dba01f6bde0 100644
--- a/libc/src/unistd/getopt.cpp
+++ b/libc/src/unistd/getopt.cpp
@@ -11,6 +11,7 @@
#include "src/__support/CPP/string_view.h"
#include "src/__support/File/file.h"
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/stdio/fprintf.h"
#include "hdr/types/FILE.h"
@@ -19,7 +20,7 @@
// just the re-ordering of argv elements such that unknown arguments can be
// easily iterated over.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
template <typename T> struct RefWrapper {
RefWrapper() = delete;
@@ -202,4 +203,4 @@ LLVM_LIBC_FUNCTION(int, getopt,
return getopt_r(argc, argv, optstring, impl::ctx);
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/getopt.h b/libc/src/unistd/getopt.h
index fe8ae5ff5b91..1be3331dcd98 100644
--- a/libc/src/unistd/getopt.h
+++ b/libc/src/unistd/getopt.h
@@ -10,9 +10,10 @@
#define LLVM_LIBC_SRC_UNISTD_GETOPT_H
#include "hdr/types/FILE.h"
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
namespace impl {
void set_getopt_state(char **, int *, int *, unsigned *, int *, FILE *);
@@ -20,6 +21,6 @@ void set_getopt_state(char **, int *, int *, unsigned *, int *, FILE *);
int getopt(int argc, char *const argv[], const char *optstring);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_GETOPT_H
diff --git a/libc/src/unistd/getpid.h b/libc/src/unistd/getpid.h
index 5890dbf63681..c3c55b0c06b1 100644
--- a/libc/src/unistd/getpid.h
+++ b/libc/src/unistd/getpid.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_GETPID_H
#define LLVM_LIBC_SRC_UNISTD_GETPID_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
pid_t getpid();
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_GETPID_H
diff --git a/libc/src/unistd/getppid.h b/libc/src/unistd/getppid.h
index a09c7ca22418..d820791bc06f 100644
--- a/libc/src/unistd/getppid.h
+++ b/libc/src/unistd/getppid.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_GETPPID_H
#define LLVM_LIBC_SRC_UNISTD_GETPPID_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
pid_t getppid();
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_GETPPID_H
diff --git a/libc/src/unistd/getuid.h b/libc/src/unistd/getuid.h
index 35163783518c..dd82c7119d40 100644
--- a/libc/src/unistd/getuid.h
+++ b/libc/src/unistd/getuid.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_GETUID_H
#define LLVM_LIBC_SRC_UNISTD_GETUID_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
uid_t getuid();
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_GETUID_H
diff --git a/libc/src/unistd/isatty.h b/libc/src/unistd/isatty.h
index 90a169730fe0..6dd1b7b81717 100644
--- a/libc/src/unistd/isatty.h
+++ b/libc/src/unistd/isatty.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_ISATTY_H
#define LLVM_LIBC_SRC_UNISTD_ISATTY_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int isatty(int fd);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_ISATTY_H
diff --git a/libc/src/unistd/link.h b/libc/src/unistd/link.h
index a95111f3a7f9..9b27aa1accf4 100644
--- a/libc/src/unistd/link.h
+++ b/libc/src/unistd/link.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_LINK_H
#define LLVM_LIBC_SRC_UNISTD_LINK_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int link(const char *, const char *);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_LINK_H
diff --git a/libc/src/unistd/linkat.h b/libc/src/unistd/linkat.h
index c53b87e5d119..bb03e31b9517 100644
--- a/libc/src/unistd/linkat.h
+++ b/libc/src/unistd/linkat.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_LINKAT_H
#define LLVM_LIBC_SRC_UNISTD_LINKAT_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int linkat(int, const char *, int, const char *, int);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_LINKAT_H
diff --git a/libc/src/unistd/linux/access.cpp b/libc/src/unistd/linux/access.cpp
index f062ad43e75f..e9ad74989b05 100644
--- a/libc/src/unistd/linux/access.cpp
+++ b/libc/src/unistd/linux/access.cpp
@@ -11,11 +11,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, access, (const char *path, int mode)) {
#ifdef SYS_access
@@ -34,4 +35,4 @@ LLVM_LIBC_FUNCTION(int, access, (const char *path, int mode)) {
return 0;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/chdir.cpp b/libc/src/unistd/linux/chdir.cpp
index 61d44ff1c808..a30d1dc883be 100644
--- a/libc/src/unistd/linux/chdir.cpp
+++ b/libc/src/unistd/linux/chdir.cpp
@@ -11,10 +11,11 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, chdir, (const char *path)) {
int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_chdir, path);
@@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, chdir, (const char *path)) {
return 0;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/close.cpp b/libc/src/unistd/linux/close.cpp
index 084334861abd..58d42a9673fb 100644
--- a/libc/src/unistd/linux/close.cpp
+++ b/libc/src/unistd/linux/close.cpp
@@ -11,10 +11,11 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, close, (int fd)) {
int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_close, fd);
@@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, close, (int fd)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/dup.cpp b/libc/src/unistd/linux/dup.cpp
index a2e7d3fdec42..c1710a37f611 100644
--- a/libc/src/unistd/linux/dup.cpp
+++ b/libc/src/unistd/linux/dup.cpp
@@ -11,10 +11,11 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, dup, (int fd)) {
int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_dup, fd);
@@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, dup, (int fd)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/dup2.cpp b/libc/src/unistd/linux/dup2.cpp
index f6804e2deca5..51a19a71a7d8 100644
--- a/libc/src/unistd/linux/dup2.cpp
+++ b/libc/src/unistd/linux/dup2.cpp
@@ -11,11 +11,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, dup2, (int oldfd, int newfd)) {
#ifdef SYS_dup2
@@ -52,4 +53,4 @@ LLVM_LIBC_FUNCTION(int, dup2, (int oldfd, int newfd)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/dup3.cpp b/libc/src/unistd/linux/dup3.cpp
index bf2c25728ca6..c096ba73c96b 100644
--- a/libc/src/unistd/linux/dup3.cpp
+++ b/libc/src/unistd/linux/dup3.cpp
@@ -11,10 +11,11 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, dup3, (int oldfd, int newfd, int flags)) {
// If dup2 syscall is available, we make use of directly.
@@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, dup3, (int oldfd, int newfd, int flags)) {
return -1;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/execv.cpp b/libc/src/unistd/linux/execv.cpp
index bd134ca523c7..a3f2525ed7ca 100644
--- a/libc/src/unistd/linux/execv.cpp
+++ b/libc/src/unistd/linux/execv.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/unistd/execv.h"
+#include "src/__support/macros/config.h"
#include "src/unistd/environ.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
@@ -15,7 +16,7 @@
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, execv, (const char *path, char *const argv[])) {
int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_execve, path, argv,
@@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(int, execv, (const char *path, char *const argv[])) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/execve.cpp b/libc/src/unistd/linux/execve.cpp
index b6de0a400c44..37162c412178 100644
--- a/libc/src/unistd/linux/execve.cpp
+++ b/libc/src/unistd/linux/execve.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/unistd/execve.h"
+#include "src/__support/macros/config.h"
#include "src/unistd/environ.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
@@ -15,7 +16,7 @@
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, execve,
(const char *path, char *const argv[], char *const envp[])) {
@@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(int, execve,
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/fchdir.cpp b/libc/src/unistd/linux/fchdir.cpp
index d24b9badfe44..8196dc63ab1e 100644
--- a/libc/src/unistd/linux/fchdir.cpp
+++ b/libc/src/unistd/linux/fchdir.cpp
@@ -11,10 +11,11 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, fchdir, (int fd)) {
int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_fchdir, fd);
@@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, fchdir, (int fd)) {
return 0;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/fork.cpp b/libc/src/unistd/linux/fork.cpp
index 6fa2b990b19a..7d47665b16d3 100644
--- a/libc/src/unistd/linux/fork.cpp
+++ b/libc/src/unistd/linux/fork.cpp
@@ -10,6 +10,7 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/__support/threads/fork_callbacks.h"
#include "src/__support/threads/thread.h" // For thread self object
@@ -17,7 +18,7 @@
#include <signal.h> // For SIGCHLD
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
// The implementation of fork here is very minimal. We will add more
// functionality and standard compliance in future.
@@ -51,4 +52,4 @@ LLVM_LIBC_FUNCTION(pid_t, fork, (void)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/fpathconf.cpp b/libc/src/unistd/linux/fpathconf.cpp
index 6643ed1cc9e8..8e0c8bcdfc22 100644
--- a/libc/src/unistd/linux/fpathconf.cpp
+++ b/libc/src/unistd/linux/fpathconf.cpp
@@ -9,10 +9,11 @@
#include "src/unistd/fpathconf.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/sys/statvfs/linux/statfs_utils.h"
#include "src/unistd/linux/pathconf_utils.h"
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(long, fpathconf, (int fd, int name)) {
if (cpp::optional<statfs_utils::LinuxStatFs> result =
@@ -21,4 +22,4 @@ LLVM_LIBC_FUNCTION(long, fpathconf, (int fd, int name)) {
return -1;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/fsync.cpp b/libc/src/unistd/linux/fsync.cpp
index 44d504ec459e..ae3895bab15f 100644
--- a/libc/src/unistd/linux/fsync.cpp
+++ b/libc/src/unistd/linux/fsync.cpp
@@ -11,10 +11,11 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, fsync, (int fd)) {
int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_fsync, fd);
@@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, fsync, (int fd)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/ftruncate.cpp b/libc/src/unistd/linux/ftruncate.cpp
index 795bb98ceae0..39cb3b5778fa 100644
--- a/libc/src/unistd/linux/ftruncate.cpp
+++ b/libc/src/unistd/linux/ftruncate.cpp
@@ -11,12 +11,13 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.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.
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, ftruncate, (int fd, off_t len)) {
#ifdef SYS_ftruncate
@@ -37,4 +38,4 @@ LLVM_LIBC_FUNCTION(int, ftruncate, (int fd, off_t len)) {
return 0;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/getcwd.cpp b/libc/src/unistd/linux/getcwd.cpp
index 11c58f158556..a10c5004d0e0 100644
--- a/libc/src/unistd/linux/getcwd.cpp
+++ b/libc/src/unistd/linux/getcwd.cpp
@@ -10,6 +10,7 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/string/allocating_string_utils.h" // For strdup.
#include "src/errno/libc_errno.h"
@@ -17,7 +18,7 @@
#include <stdlib.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
namespace {
@@ -63,4 +64,4 @@ LLVM_LIBC_FUNCTION(char *, getcwd, (char *buf, size_t size)) {
return buf;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/geteuid.cpp b/libc/src/unistd/linux/geteuid.cpp
index 2a7f163fb8cd..a4bbcc0cb312 100644
--- a/libc/src/unistd/linux/geteuid.cpp
+++ b/libc/src/unistd/linux/geteuid.cpp
@@ -10,13 +10,14 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(uid_t, geteuid, ()) {
return LIBC_NAMESPACE::syscall_impl<uid_t>(SYS_geteuid);
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/getpid.cpp b/libc/src/unistd/linux/getpid.cpp
index 85730738ca2e..b24c86a15990 100644
--- a/libc/src/unistd/linux/getpid.cpp
+++ b/libc/src/unistd/linux/getpid.cpp
@@ -10,13 +10,14 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(pid_t, getpid, ()) {
return LIBC_NAMESPACE::syscall_impl<pid_t>(SYS_getpid);
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/getppid.cpp b/libc/src/unistd/linux/getppid.cpp
index 7ee11f32fd00..c55329daa9f9 100644
--- a/libc/src/unistd/linux/getppid.cpp
+++ b/libc/src/unistd/linux/getppid.cpp
@@ -10,13 +10,14 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(pid_t, getppid, ()) {
return LIBC_NAMESPACE::syscall_impl<pid_t>(SYS_getppid);
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/getuid.cpp b/libc/src/unistd/linux/getuid.cpp
index c8131803c84a..ce818ec91bd2 100644
--- a/libc/src/unistd/linux/getuid.cpp
+++ b/libc/src/unistd/linux/getuid.cpp
@@ -10,13 +10,14 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(uid_t, getuid, ()) {
return LIBC_NAMESPACE::syscall_impl<uid_t>(SYS_getuid);
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/isatty.cpp b/libc/src/unistd/linux/isatty.cpp
index 205013897525..e6ea22a714c7 100644
--- a/libc/src/unistd/linux/isatty.cpp
+++ b/libc/src/unistd/linux/isatty.cpp
@@ -11,11 +11,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/ioctl.h> // For ioctl numbers.
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, isatty, (int fd)) {
constexpr int INIT_VAL = 0x1234abcd;
@@ -31,4 +32,4 @@ LLVM_LIBC_FUNCTION(int, isatty, (int fd)) {
return 0;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/link.cpp b/libc/src/unistd/linux/link.cpp
index b5024ad7a59f..37ca58eab109 100644
--- a/libc/src/unistd/linux/link.cpp
+++ b/libc/src/unistd/linux/link.cpp
@@ -10,12 +10,13 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, link, (const char *path1, const char *path2)) {
#ifdef SYS_link
@@ -33,4 +34,4 @@ LLVM_LIBC_FUNCTION(int, link, (const char *path1, const char *path2)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/linkat.cpp b/libc/src/unistd/linux/linkat.cpp
index c5d071ee83e0..fcd6a5f75a19 100644
--- a/libc/src/unistd/linux/linkat.cpp
+++ b/libc/src/unistd/linux/linkat.cpp
@@ -11,11 +11,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, linkat,
(int fd1, const char *path1, int fd2, const char *path2,
@@ -29,4 +30,4 @@ LLVM_LIBC_FUNCTION(int, linkat,
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/lseek.cpp b/libc/src/unistd/linux/lseek.cpp
index 6f3d9937db24..9486cecf3b12 100644
--- a/libc/src/unistd/linux/lseek.cpp
+++ b/libc/src/unistd/linux/lseek.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/unistd/lseek.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/__support/File/linux/lseekImpl.h"
@@ -16,7 +17,7 @@
#include <sys/syscall.h> // For syscall numbers.
#include <unistd.h> // For off_t.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(off_t, lseek, (int fd, off_t offset, int whence)) {
auto result = internal::lseekimpl(fd, offset, whence);
@@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(off_t, lseek, (int fd, off_t offset, int whence)) {
return result.value();
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/pathconf.cpp b/libc/src/unistd/linux/pathconf.cpp
index 11427698232b..ca1c10bb9f7f 100644
--- a/libc/src/unistd/linux/pathconf.cpp
+++ b/libc/src/unistd/linux/pathconf.cpp
@@ -7,11 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/unistd/pathconf.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/sys/statvfs/linux/statfs_utils.h"
#include "src/unistd/linux/pathconf_utils.h"
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(long, pathconf, (const char *path, int name)) {
if (cpp::optional<statfs_utils::LinuxStatFs> result =
@@ -20,4 +21,4 @@ LLVM_LIBC_FUNCTION(long, pathconf, (const char *path, int name)) {
return -1;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/pathconf_utils.cpp b/libc/src/unistd/linux/pathconf_utils.cpp
index 3f963ab5aaaf..035e628dff25 100644
--- a/libc/src/unistd/linux/pathconf_utils.cpp
+++ b/libc/src/unistd/linux/pathconf_utils.cpp
@@ -14,6 +14,7 @@
#include "hdr/unistd_macros.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/sys/statvfs/linux/statfs_utils.h"
@@ -27,7 +28,7 @@
#endif
#include <linux/magic.h> // For common FS magics
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
long filesizebits(const statfs_utils::LinuxStatFs &s) {
switch (s.f_type) {
@@ -124,4 +125,4 @@ long pathconfig(const statfs_utils::LinuxStatFs &s, int name) {
}
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/pathconf_utils.h b/libc/src/unistd/linux/pathconf_utils.h
index 2c0ec0ea292f..bd34de23cc38 100644
--- a/libc/src/unistd/linux/pathconf_utils.h
+++ b/libc/src/unistd/linux/pathconf_utils.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_PATHCONF_UTILS_H
#define LLVM_LIBC_SRC_UNISTD_PATHCONF_UTILS_H
+#include "src/__support/macros/config.h"
#include "src/sys/statvfs/linux/statfs_utils.h"
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
long pathconfig(const statfs_utils::LinuxStatFs &s, int name);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_PREAD_H
diff --git a/libc/src/unistd/linux/pipe.cpp b/libc/src/unistd/linux/pipe.cpp
index 8cfb8d1d5c2c..dfcd5bfdaf53 100644
--- a/libc/src/unistd/linux/pipe.cpp
+++ b/libc/src/unistd/linux/pipe.cpp
@@ -10,11 +10,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/__support/macros/sanitizer.h" // for MSAN_UNPOISON
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, pipe, (int pipefd[2])) {
#ifdef SYS_pipe
@@ -32,4 +33,4 @@ LLVM_LIBC_FUNCTION(int, pipe, (int pipefd[2])) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/pread.cpp b/libc/src/unistd/linux/pread.cpp
index 247a7b4d9d50..3e27857f9a2b 100644
--- a/libc/src/unistd/linux/pread.cpp
+++ b/libc/src/unistd/linux/pread.cpp
@@ -10,12 +10,13 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/__support/macros/sanitizer.h" // for MSAN_UNPOISON
#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 {
LLVM_LIBC_FUNCTION(ssize_t, pread,
(int fd, void *buf, size_t count, off_t offset)) {
@@ -44,4 +45,4 @@ LLVM_LIBC_FUNCTION(ssize_t, pread,
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/pwrite.cpp b/libc/src/unistd/linux/pwrite.cpp
index b0540a09710e..1b81b2a05949 100644
--- a/libc/src/unistd/linux/pwrite.cpp
+++ b/libc/src/unistd/linux/pwrite.cpp
@@ -11,11 +11,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.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 {
LLVM_LIBC_FUNCTION(ssize_t, pwrite,
(int fd, const void *buf, size_t count, off_t offset)) {
@@ -43,4 +44,4 @@ LLVM_LIBC_FUNCTION(ssize_t, pwrite,
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/read.cpp b/libc/src/unistd/linux/read.cpp
index 41be1eb10c0d..4419900f2330 100644
--- a/libc/src/unistd/linux/read.cpp
+++ b/libc/src/unistd/linux/read.cpp
@@ -10,11 +10,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/__support/macros/sanitizer.h" // for MSAN_UNPOISON
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(ssize_t, read, (int fd, void *buf, size_t count)) {
ssize_t ret = LIBC_NAMESPACE::syscall_impl<ssize_t>(SYS_read, fd, buf, count);
@@ -28,4 +29,4 @@ LLVM_LIBC_FUNCTION(ssize_t, read, (int fd, void *buf, size_t count)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/readlink.cpp b/libc/src/unistd/linux/readlink.cpp
index 8dee58c8f215..7b1524500440 100644
--- a/libc/src/unistd/linux/readlink.cpp
+++ b/libc/src/unistd/linux/readlink.cpp
@@ -11,11 +11,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(ssize_t, readlink,
(const char *__restrict path, char *__restrict buf,
@@ -36,4 +37,4 @@ LLVM_LIBC_FUNCTION(ssize_t, readlink,
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/readlinkat.cpp b/libc/src/unistd/linux/readlinkat.cpp
index 479735d4f4d3..19a9ff9fbeb7 100644
--- a/libc/src/unistd/linux/readlinkat.cpp
+++ b/libc/src/unistd/linux/readlinkat.cpp
@@ -11,11 +11,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(ssize_t, readlinkat,
(int fd, const char *__restrict path, char *__restrict buf,
@@ -29,4 +30,4 @@ LLVM_LIBC_FUNCTION(ssize_t, readlinkat,
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/rmdir.cpp b/libc/src/unistd/linux/rmdir.cpp
index 234b0c3a0940..8974468ebcf1 100644
--- a/libc/src/unistd/linux/rmdir.cpp
+++ b/libc/src/unistd/linux/rmdir.cpp
@@ -10,12 +10,13 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, rmdir, (const char *path)) {
#ifdef SYS_rmdir
@@ -34,4 +35,4 @@ LLVM_LIBC_FUNCTION(int, rmdir, (const char *path)) {
return 0;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/symlink.cpp b/libc/src/unistd/linux/symlink.cpp
index e8983e252b8e..5efd4df85eda 100644
--- a/libc/src/unistd/linux/symlink.cpp
+++ b/libc/src/unistd/linux/symlink.cpp
@@ -10,12 +10,13 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, symlink, (const char *path1, const char *path2)) {
#ifdef SYS_symlink
@@ -33,4 +34,4 @@ LLVM_LIBC_FUNCTION(int, symlink, (const char *path1, const char *path2)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/symlinkat.cpp b/libc/src/unistd/linux/symlinkat.cpp
index 64f02d13f9a0..63d2e6d1507a 100644
--- a/libc/src/unistd/linux/symlinkat.cpp
+++ b/libc/src/unistd/linux/symlinkat.cpp
@@ -11,11 +11,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, symlinkat,
(const char *path1, int fd, const char *path2)) {
@@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(int, symlinkat,
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/syscall.cpp b/libc/src/unistd/linux/syscall.cpp
index e0070fe6d805..5394bff46adf 100644
--- a/libc/src/unistd/linux/syscall.cpp
+++ b/libc/src/unistd/linux/syscall.cpp
@@ -11,10 +11,11 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <stdarg.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(long, __llvm_libc_syscall,
(long number, long arg1, long arg2, long arg3, long arg4,
@@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(long, __llvm_libc_syscall,
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/sysconf.cpp b/libc/src/unistd/linux/sysconf.cpp
index d4577c8d3d76..1540eb499ec1 100644
--- a/libc/src/unistd/linux/sysconf.cpp
+++ b/libc/src/unistd/linux/sysconf.cpp
@@ -10,12 +10,13 @@
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/sys/auxv/getauxval.h"
#include <sys/auxv.h>
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(long, sysconf, (int name)) {
long ret = 0;
@@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(long, sysconf, (int name)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/truncate.cpp b/libc/src/unistd/linux/truncate.cpp
index 0120cc738a92..283cf4098cf4 100644
--- a/libc/src/unistd/linux/truncate.cpp
+++ b/libc/src/unistd/linux/truncate.cpp
@@ -10,13 +10,14 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.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.
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, truncate, (const char *path, off_t len)) {
#ifdef SYS_truncate
@@ -36,4 +37,4 @@ LLVM_LIBC_FUNCTION(int, truncate, (const char *path, off_t len)) {
return 0;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/unlink.cpp b/libc/src/unistd/linux/unlink.cpp
index e62fb8faa67a..de7cae8b826e 100644
--- a/libc/src/unistd/linux/unlink.cpp
+++ b/libc/src/unistd/linux/unlink.cpp
@@ -11,11 +11,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, unlink, (const char *path)) {
#ifdef SYS_unlink
@@ -33,4 +34,4 @@ LLVM_LIBC_FUNCTION(int, unlink, (const char *path)) {
return 0;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/unlinkat.cpp b/libc/src/unistd/linux/unlinkat.cpp
index 4ec5e38cb405..e794f242b945 100644
--- a/libc/src/unistd/linux/unlinkat.cpp
+++ b/libc/src/unistd/linux/unlinkat.cpp
@@ -10,12 +10,13 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, unlinkat, (int dfd, const char *path, int flags)) {
#ifdef SYS_unlinkat
@@ -31,4 +32,4 @@ LLVM_LIBC_FUNCTION(int, unlinkat, (int dfd, const char *path, int flags)) {
return 0;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/linux/write.cpp b/libc/src/unistd/linux/write.cpp
index bd6c9114f787..99d5ab7e480b 100644
--- a/libc/src/unistd/linux/write.cpp
+++ b/libc/src/unistd/linux/write.cpp
@@ -10,11 +10,12 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(ssize_t, write, (int fd, const void *buf, size_t count)) {
ssize_t ret =
@@ -26,4 +27,4 @@ LLVM_LIBC_FUNCTION(ssize_t, write, (int fd, const void *buf, size_t count)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/lseek.h b/libc/src/unistd/lseek.h
index 75e33d8a6987..a8704ec7058d 100644
--- a/libc/src/unistd/lseek.h
+++ b/libc/src/unistd/lseek.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_LSEEK_H
#define LLVM_LIBC_SRC_UNISTD_LSEEK_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
off_t lseek(int fd, off_t offset, int whence);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_LSEEK_H
diff --git a/libc/src/unistd/pathconf.h b/libc/src/unistd/pathconf.h
index 6543d738a9b2..d6b891ea8be6 100644
--- a/libc/src/unistd/pathconf.h
+++ b/libc/src/unistd/pathconf.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_PATHCONF_H
#define LLVM_LIBC_SRC_UNISTD_PATHCONF_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
long pathconf(const char *path, int name);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_PREAD_H
diff --git a/libc/src/unistd/pipe.h b/libc/src/unistd/pipe.h
index 0e20bb49c058..d5cccf3ad7b1 100644
--- a/libc/src/unistd/pipe.h
+++ b/libc/src/unistd/pipe.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_PIPE_H
#define LLVM_LIBC_SRC_UNISTD_PIPE_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int pipe(int pipefd[2]);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_PIPE_H
diff --git a/libc/src/unistd/pread.h b/libc/src/unistd/pread.h
index 6ecfef4c82c6..4723675e82a2 100644
--- a/libc/src/unistd/pread.h
+++ b/libc/src/unistd/pread.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_PREAD_H
#define LLVM_LIBC_SRC_UNISTD_PREAD_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_PREAD_H
diff --git a/libc/src/unistd/pwrite.h b/libc/src/unistd/pwrite.h
index 535c9217c235..baffbe48b643 100644
--- a/libc/src/unistd/pwrite.h
+++ b/libc/src/unistd/pwrite.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_PWRITE_H
#define LLVM_LIBC_SRC_UNISTD_PWRITE_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_PWRITE_H
diff --git a/libc/src/unistd/read.h b/libc/src/unistd/read.h
index 05a56a2fdeae..01231cb82e35 100644
--- a/libc/src/unistd/read.h
+++ b/libc/src/unistd/read.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_READ_H
#define LLVM_LIBC_SRC_UNISTD_READ_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
ssize_t read(int fd, void *buf, size_t count);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_READ_H
diff --git a/libc/src/unistd/readlink.h b/libc/src/unistd/readlink.h
index c93c430988c7..a73e9740c746 100644
--- a/libc/src/unistd/readlink.h
+++ b/libc/src/unistd/readlink.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_READLINK_H
#define LLVM_LIBC_SRC_UNISTD_READLINK_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
ssize_t readlink(const char *__restrict, char *__restrict, size_t);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_READLINK_H
diff --git a/libc/src/unistd/readlinkat.h b/libc/src/unistd/readlinkat.h
index a4357efec1a1..6bdd48b537fc 100644
--- a/libc/src/unistd/readlinkat.h
+++ b/libc/src/unistd/readlinkat.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_READLINKAT_H
#define LLVM_LIBC_SRC_UNISTD_READLINKAT_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
ssize_t readlinkat(int, const char *__restrict, char *__restrict, size_t);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_READLINKAT_H
diff --git a/libc/src/unistd/rmdir.h b/libc/src/unistd/rmdir.h
index 55dcbafe1f7d..abf5bf720f30 100644
--- a/libc/src/unistd/rmdir.h
+++ b/libc/src/unistd/rmdir.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_RMDIR_H
#define LLVM_LIBC_SRC_UNISTD_RMDIR_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int rmdir(const char *path);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_RMDIR_H
diff --git a/libc/src/unistd/swab.cpp b/libc/src/unistd/swab.cpp
index 5c2f5074ff97..643079a40ab5 100644
--- a/libc/src/unistd/swab.cpp
+++ b/libc/src/unistd/swab.cpp
@@ -9,8 +9,9 @@
#include "src/unistd/swab.h"
#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(void, swab,
(const void *__restrict from, void *__restrict to,
@@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(void, swab,
}
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/unistd/swab.h b/libc/src/unistd/swab.h
index 0a6aa49540b5..caa9c7100109 100644
--- a/libc/src/unistd/swab.h
+++ b/libc/src/unistd/swab.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_SWAB_H
#define LLVM_LIBC_SRC_UNISTD_SWAB_H
+#include "src/__support/macros/config.h"
#include <unistd.h> // For ssize_t
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
void swab(const void *__restrict from, void *__restrict to, ssize_t n);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_SWAB_H
diff --git a/libc/src/unistd/symlink.h b/libc/src/unistd/symlink.h
index 0a0124ccbc7a..47f04f8845b4 100644
--- a/libc/src/unistd/symlink.h
+++ b/libc/src/unistd/symlink.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_SYMLINK_H
#define LLVM_LIBC_SRC_UNISTD_SYMLINK_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int symlink(const char *, const char *);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_SYMLINK_H
diff --git a/libc/src/unistd/symlinkat.h b/libc/src/unistd/symlinkat.h
index ecca4380e98e..9f8ad517af5a 100644
--- a/libc/src/unistd/symlinkat.h
+++ b/libc/src/unistd/symlinkat.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_SYMLINKAT_H
#define LLVM_LIBC_SRC_UNISTD_SYMLINKAT_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int symlinkat(const char *, int, const char *);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_SYMLINKAT_H
diff --git a/libc/src/unistd/syscall.h b/libc/src/unistd/syscall.h
index a41d9778e055..db70745719cf 100644
--- a/libc/src/unistd/syscall.h
+++ b/libc/src/unistd/syscall.h
@@ -9,14 +9,15 @@
#ifndef LLVM_LIBC_SRC_UNISTD_SYSCALL_H
#define LLVM_LIBC_SRC_UNISTD_SYSCALL_H
+#include "src/__support/macros/config.h"
#include <stdarg.h>
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
long __llvm_libc_syscall(long number, long arg1, long arg2, long arg3,
long arg4, long arg5, long arg6);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_SYSCALL_H
diff --git a/libc/src/unistd/sysconf.h b/libc/src/unistd/sysconf.h
index 89c5efa57463..1b3f39e41350 100644
--- a/libc/src/unistd/sysconf.h
+++ b/libc/src/unistd/sysconf.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_SYSCONF_H
#define LLVM_LIBC_SRC_UNISTD_SYSCONF_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
long sysconf(int name);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_SYSCONF_H
diff --git a/libc/src/unistd/truncate.h b/libc/src/unistd/truncate.h
index 5245b6bf2ed0..9ba5cf831752 100644
--- a/libc/src/unistd/truncate.h
+++ b/libc/src/unistd/truncate.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_TRUNCATE_H
#define LLVM_LIBC_SRC_UNISTD_TRUNCATE_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int truncate(const char *, off_t);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_TRUNCATE_H
diff --git a/libc/src/unistd/unlink.h b/libc/src/unistd/unlink.h
index d1d34fa1a8ac..71ef19fa22c1 100644
--- a/libc/src/unistd/unlink.h
+++ b/libc/src/unistd/unlink.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_UNLINK_H
#define LLVM_LIBC_SRC_UNISTD_UNLINK_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int unlink(const char *path);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_UNLINK_H
diff --git a/libc/src/unistd/unlinkat.h b/libc/src/unistd/unlinkat.h
index 81d23bdf5cec..2ce46b8ec8a8 100644
--- a/libc/src/unistd/unlinkat.h
+++ b/libc/src/unistd/unlinkat.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_UNISTD_UNLINKAT_H
#define LLVM_LIBC_SRC_UNISTD_UNLINKAT_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int unlinkat(int dfd, const char *path, int flags);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_UNLINKAT_H
diff --git a/libc/src/unistd/write.h b/libc/src/unistd/write.h
index 52cdff348085..e40ce19e2176 100644
--- a/libc/src/unistd/write.h
+++ b/libc/src/unistd/write.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_UNISTD_WRITE_H
#define LLVM_LIBC_SRC_UNISTD_WRITE_H
+#include "src/__support/macros/config.h"
#include <unistd.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
ssize_t write(int fd, const void *buf, size_t count);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_UNISTD_WRITE_H