Skip to content

Commit bc3482b

Browse files
committed
[libc][annex_k] Add rsize_t.
1 parent 370104d commit bc3482b

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

libc/hdr/types/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ add_proxy_header_library(
135135
libc.include.llvm-libc-types.struct_tm
136136
)
137137

138+
add_proxy_header_library(
139+
rsize_t
140+
HDRS
141+
rsize_t.h
142+
FULL_BUILD_DEPENDS
143+
libc.include.llvm-libc-types.rsize_t
144+
)
145+
138146
add_proxy_header_library(
139147
size_t
140148
HDRS

libc/hdr/types/rsize_t.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===-- Proxy for rsize_t -------------------------------------------------===//
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+
#ifndef LLVM_LIBC_HDR_TYPES_SIZE_T_H
9+
#define LLVM_LIBC_HDR_TYPES_SIZE_T_H
10+
11+
#ifdef LIBC_FULL_BUILD
12+
13+
#include "include/llvm-libc-types/rsize_t.h"
14+
15+
#else
16+
17+
#define __need_rsize_t
18+
#include <stddef.h>
19+
#undef __need_rsize_t
20+
21+
#endif // LIBC_FULL_BUILD
22+
23+
#endif // LLVM_LIBC_HDR_TYPES_SIZE_T_H

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_header(off64_t HDR off64_t.h)
2+
add_header(rsize_t HDR rsize_t.h)
23
add_header(size_t HDR size_t.h)
34
add_header(ssize_t HDR ssize_t.h)
45
add_header(__atfork_callback_t HDR __atfork_callback_t.h)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===-- Definition of size_t types ----------------------------------------===//
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_RSIZE_T_H
10+
#define LLVM_LIBC_TYPES_RSIZE_T_H
11+
12+
#ifdef LIBC_HAS_ANNEX_K
13+
14+
typedef __SIZE_TYPE__ rsize_t;
15+
16+
#endif // LIBC_HAS_ANNEX_K
17+
18+
#endif // LLVM_LIBC_TYPES_RSIZE_T_H

0 commit comments

Comments
 (0)