diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt index b1b4a4fd20982..5f836e0f480e1 100644 --- a/libc/include/CMakeLists.txt +++ b/libc/include/CMakeLists.txt @@ -216,8 +216,11 @@ add_header_macro( ../libc/include/netinet/in.yaml netinet/in.h DEPENDS - .llvm_libc_common_h .llvm-libc-macros.netinet_in_macros + .llvm-libc-types.in_addr_t + .llvm-libc-types.in_port_t + .llvm-libc-types.sa_family_t + .llvm_libc_common_h ) add_header_macro( diff --git a/libc/include/llvm-libc-types/CMakeLists.txt b/libc/include/llvm-libc-types/CMakeLists.txt index e967b43d81df0..aad6650d90428 100644 --- a/libc/include/llvm-libc-types/CMakeLists.txt +++ b/libc/include/llvm-libc-types/CMakeLists.txt @@ -57,6 +57,7 @@ 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_port_t HDR in_port_t.h DEPENDS libc.include.llvm-libc-macros.stdint_macros) add_header(struct_in_addr HDR struct_in_addr.h DEPENDS .in_addr_t) add_header(ino_t HDR ino_t.h) add_header(key_t HDR key_t.h) diff --git a/libc/include/llvm-libc-types/in_port_t.h b/libc/include/llvm-libc-types/in_port_t.h new file mode 100644 index 0000000000000..daf33f91d95af --- /dev/null +++ b/libc/include/llvm-libc-types/in_port_t.h @@ -0,0 +1,16 @@ +//===-- Definition of in_port_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_PORT_T_H +#define LLVM_LIBC_TYPES_IN_PORT_T_H + +#include "../llvm-libc-types/stdint-macros.h" + +typedef uint16_t in_port_t; + +#endif // LLVM_LIBC_TYPES_IN_PORT_T_H diff --git a/libc/include/netinet/in.yaml b/libc/include/netinet/in.yaml index e7b33dc87334f..8d9749f36ab78 100644 --- a/libc/include/netinet/in.yaml +++ b/libc/include/netinet/in.yaml @@ -14,7 +14,10 @@ macros: macro_header: netinet-in-macros.h - macro_name: IPPROTO_RAW macro_header: netinet-in-macros.h -types: [] +types: + - type_name: in_port_t + - type_name: in_addr_t + - type_name: sa_family_t enums: [] objects: [] functions: []