Skip to content

Commit be301a6

Browse files
authored
[libc] add in_addr{, _t} type (#162452)
These types will be used in `arpa/inet.h` and `netinet/in.h`.
1 parent 0db5ba0 commit be301a6

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

libc/include/llvm-libc-types/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ add_header(float_t HDR float_t.h)
3939
add_header(gid_t HDR gid_t.h)
4040
add_header(uid_t HDR uid_t.h)
4141
add_header(imaxdiv_t HDR imaxdiv_t.h)
42+
add_header(in_addr_t HDR in_addr_t.h)
43+
add_header(in_addr HDR in_addr.h DEPENDS .in_addr_t)
4244
add_header(ino_t HDR ino_t.h)
4345
add_header(mbstate_t HDR mbstate_t.h)
4446
add_header(mode_t HDR mode_t.h)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===-- Definition of in_addr type ----------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_TYPES_IN_ADDR_H
10+
#define LLVM_LIBC_TYPES_IN_ADDR_H
11+
12+
#include "in_addr_t.h"
13+
14+
typedef struct {
15+
in_addr_t s_addr;
16+
} in_addr;
17+
18+
#endif // LLVM_LIBC_TYPES_IN_ADDR_H
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//===-- Definition of in_addr_t type --------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_TYPES_IN_ADDR_T_H
10+
#define LLVM_LIBC_TYPES_IN_ADDR_T_H
11+
12+
typedef __UINT32_TYPE__ in_addr_t;
13+
14+
#endif // LLVM_LIBC_TYPES_IN_ADDR_T_H

0 commit comments

Comments
 (0)