Skip to content

Conversation

c8ef
Copy link
Contributor

@c8ef c8ef commented Oct 8, 2025

These types will be used in arpa/inet.h and netinet/in.h.

@llvmbot llvmbot added the libc label Oct 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 8, 2025

@llvm/pr-subscribers-libc

Author: Connector Switch (c8ef)

Changes

These types will be used in arpa/inet.h and netinet/in.h.


Full diff: https://github.com/llvm/llvm-project/pull/162452.diff

3 Files Affected:

  • (modified) libc/include/llvm-libc-types/CMakeLists.txt (+2)
  • (added) libc/include/llvm-libc-types/in_addr.h (+18)
  • (added) libc/include/llvm-libc-types/in_addr_t.h (+14)
diff --git a/libc/include/llvm-libc-types/CMakeLists.txt b/libc/include/llvm-libc-types/CMakeLists.txt
index 70da983be9090..5f506c4d25c9b 100644
--- a/libc/include/llvm-libc-types/CMakeLists.txt
+++ b/libc/include/llvm-libc-types/CMakeLists.txt
@@ -39,6 +39,8 @@ add_header(float_t HDR float_t.h)
 add_header(gid_t HDR gid_t.h)
 add_header(uid_t HDR uid_t.h)
 add_header(imaxdiv_t HDR imaxdiv_t.h)
+add_header(in_addr_t HDR in_addr_t.h)
+add_header(in_addr HDR in_addr.h DEPENDS .in_addr_t)
 add_header(ino_t HDR ino_t.h)
 add_header(mbstate_t HDR mbstate_t.h)
 add_header(mode_t HDR mode_t.h)
diff --git a/libc/include/llvm-libc-types/in_addr.h b/libc/include/llvm-libc-types/in_addr.h
new file mode 100644
index 0000000000000..97483c671b8e8
--- /dev/null
+++ b/libc/include/llvm-libc-types/in_addr.h
@@ -0,0 +1,18 @@
+//===-- Definition of in_addr type ----------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_TYPES_IN_ADDR_H
+#define LLVM_LIBC_TYPES_IN_ADDR_H
+
+#include "in_addr_t.h"
+
+typedef struct in_addr {
+  in_addr_t s_addr;
+} in_addr;
+
+#endif // LLVM_LIBC_TYPES_IN_ADDR_H
diff --git a/libc/include/llvm-libc-types/in_addr_t.h b/libc/include/llvm-libc-types/in_addr_t.h
new file mode 100644
index 0000000000000..334b073d9ca9c
--- /dev/null
+++ b/libc/include/llvm-libc-types/in_addr_t.h
@@ -0,0 +1,14 @@
+//===-- Definition of in_addr_t type --------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_TYPES_IN_ADDR_T_H
+#define LLVM_LIBC_TYPES_IN_ADDR_T_H
+
+typedef __UINT32_TYPE__ in_addr_t;
+
+#endif // LLVM_LIBC_TYPES_IN_ADDR_T_H

@c8ef c8ef requested review from lntue and michaelrj-google October 8, 2025 11:40
@c8ef c8ef merged commit be301a6 into llvm:main Oct 8, 2025
19 checks passed
@c8ef c8ef deleted the inaddr branch October 8, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants