summaryrefslogtreecommitdiff
path: root/libc/src/sys/socket
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2024-07-11 12:35:22 -0700
committerGitHub <noreply@github.com>2024-07-11 12:35:22 -0700
commit3f30effe1bd81fa1b039218a9bfe79c3b03fafad (patch)
treef3f9bbaca2e1088607359c74c4c696742383c032 /libc/src/sys/socket
parent2d7e136fc0e31207b962397250bc1581203c8d59 (diff)
[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)
This is a part of #97655.
Diffstat (limited to 'libc/src/sys/socket')
-rw-r--r--libc/src/sys/socket/bind.h5
-rw-r--r--libc/src/sys/socket/linux/bind.cpp5
-rw-r--r--libc/src/sys/socket/linux/socket.cpp5
-rw-r--r--libc/src/sys/socket/socket.h6
4 files changed, 13 insertions, 8 deletions
diff --git a/libc/src/sys/socket/bind.h b/libc/src/sys/socket/bind.h
index 62e6221bf1b2..1676ab6a003a 100644
--- a/libc/src/sys/socket/bind.h
+++ b/libc/src/sys/socket/bind.h
@@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_SYS_SOCKET_BIND_H
#define LLVM_LIBC_SRC_SYS_SOCKET_BIND_H
+#include "src/__support/macros/config.h"
#include <sys/socket.h>
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
int bind(int domain, const struct sockaddr *address, socklen_t address_len);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_SYS_SOCKET_BIND_H
diff --git a/libc/src/sys/socket/linux/bind.cpp b/libc/src/sys/socket/linux/bind.cpp
index 36afc646d29f..3289e9f0852e 100644
--- a/libc/src/sys/socket/linux/bind.cpp
+++ b/libc/src/sys/socket/linux/bind.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 <linux/net.h> // For SYS_SOCKET socketcall number.
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, bind,
(int domain, const struct sockaddr *address,
@@ -40,4 +41,4 @@ LLVM_LIBC_FUNCTION(int, bind,
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/sys/socket/linux/socket.cpp b/libc/src/sys/socket/linux/socket.cpp
index 90a7dc632e26..3e6df4d487a5 100644
--- a/libc/src/sys/socket/linux/socket.cpp
+++ b/libc/src/sys/socket/linux/socket.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 <linux/net.h> // For SYS_SOCKET socketcall number.
#include <sys/syscall.h> // For syscall numbers.
-namespace LIBC_NAMESPACE {
+namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, socket, (int domain, int type, int protocol)) {
#ifdef SYS_socket
@@ -38,4 +39,4 @@ LLVM_LIBC_FUNCTION(int, socket, (int domain, int type, int protocol)) {
return ret;
}
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/sys/socket/socket.h b/libc/src/sys/socket/socket.h
index a6578989d2af..253be738bf31 100644
--- a/libc/src/sys/socket/socket.h
+++ b/libc/src/sys/socket/socket.h
@@ -9,10 +9,12 @@
#ifndef LLVM_LIBC_SRC_SYS_SOCKET_SOCKET_H
#define LLVM_LIBC_SRC_SYS_SOCKET_SOCKET_H
-namespace LIBC_NAMESPACE {
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
int socket(int domain, int type, int protocol);
-} // namespace LIBC_NAMESPACE
+} // namespace LIBC_NAMESPACE_DECL
#endif // LLVM_LIBC_SRC_SYS_SOCKET_SOCKET_H