Skip to content

Commit 1d6c270

Browse files
committed
[libc][annex_k] Add constraint_handler_t.
1 parent c74da0b commit 1d6c270

File tree

6 files changed

+52
-0
lines changed

6 files changed

+52
-0
lines changed

libc/hdr/types/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ add_proxy_header_library(
170170
libc.include.fcntl
171171
)
172172

173+
add_proxy_header_library(
174+
constraint_handler_t
175+
HDRS
176+
constraint_handler_t.h
177+
FULL_BUILD_DEPENDS
178+
libc.include.llvm-libc-types.constraint_handler_t
179+
libc.include.stdlib
180+
)
181+
173182
add_proxy_header_library(
174183
errno_t
175184
HDRS
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===-- Proxy for constraint_handler_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+
9+
#ifndef LLVM_LIBC_HDR_TYPES_CONSTRAINT_HANDLER_T_H
10+
#define LLVM_LIBC_HDR_TYPES_CONSTRAINT_HANDLER_T_H
11+
12+
#define LIBC_HAS_ANNEX_K
13+
14+
#include "include/llvm-libc-types/constraint_handler_t.h"
15+
16+
#undef LIBC_HAS_ANNEX_K
17+
18+
#endif // LLVM_LIBC_HDR_TYPES_CONSTRAINT_HANDLER_T_H

libc/include/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ add_header_macro(
366366
.llvm-libc-types.__qsortcompare_t
367367
.llvm-libc-types.__qsortrcompare_t
368368
.llvm-libc-types.__search_compare_t
369+
.llvm-libc-types.constraint_handler_t
369370
.llvm-libc-types.div_t
370371
.llvm-libc-types.ldiv_t
371372
.llvm-libc-types.lldiv_t

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,3 +300,5 @@ add_header(EFI_SYSTEM_TABLE
300300
.EFI_TABLE_HEADER
301301
.char16_t
302302
)
303+
304+
add_header(constraint_handler_t HDR constraint_handler_t.h DEPENDS .errno_t)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//===-- Definition of type constraint_handler_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+
9+
#ifndef LLVM_LIBC_INCLUDE_LLVM_LIBC_TYPES_CONSTRAINT_HANDLER_T_H
10+
#define LLVM_LIBC_INCLUDE_LLVM_LIBC_TYPES_CONSTRAINT_HANDLER_T_H
11+
12+
#include "errno_t.h"
13+
14+
#ifdef LIBC_HAS_ANNEX_K
15+
16+
typedef void (*constraint_handler_t)(const char *__restrict, void *__restrict,
17+
errno_t);
18+
19+
#endif // LIBC_HAS_ANNEX_K
20+
21+
#endif // LLVM_LIBC_INCLUDE_LLVM_LIBC_TYPES_CONSTRAINT_HANDLER_T_H

libc/include/stdlib.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ types:
1212
- type_name: __qsortcompare_t
1313
- type_name: __qsortrcompare_t
1414
- type_name: __search_compare_t
15+
- type_name: constraint_handler_t
1516
- type_name: div_t
1617
- type_name: ldiv_t
1718
- type_name: lldiv_t

0 commit comments

Comments
 (0)