[libc] Combine the function prototype int (*compar)(const void *, const void *) (#134238)

Closes #134118.
This commit is contained in:
Connector Switch
2025-04-04 00:36:23 +08:00
committed by GitHub
parent 65fa57bdcc
commit b738b82699
6 changed files with 24 additions and 39 deletions

View File

@@ -240,13 +240,13 @@ add_header_macro(
../libc/include/search.yaml
search.h
DEPENDS
.llvm_libc_common_h
.llvm-libc-types.ACTION
.llvm-libc-types.ENTRY
.llvm-libc-types.struct_hsearch_data
.llvm-libc-types.size_t
.llvm-libc-types.VISIT
.llvm-libc-types.__lsearchcompare_t
.llvm-libc-types.__search_compare_t
.llvm-libc-types.size_t
.llvm-libc-types.struct_hsearch_data
.llvm_libc_common_h
)
add_header_macro(
@@ -343,17 +343,17 @@ add_header_macro(
../libc/include/stdlib.yaml
stdlib.h
DEPENDS
.llvm_libc_common_h
.llvm-libc-macros.stdlib_macros
.llvm-libc-types.__atexithandler_t
.llvm-libc-types.__qsortcompare_t
.llvm-libc-types.__qsortrcompare_t
.llvm-libc-types.__search_compare_t
.llvm-libc-types.div_t
.llvm-libc-types.ldiv_t
.llvm-libc-types.lldiv_t
.llvm-libc-types.size_t
.llvm-libc-types.__bsearchcompare_t
.llvm-libc-types.__qsortcompare_t
.llvm-libc-types.__qsortrcompare_t
.llvm-libc-types.__atexithandler_t
.llvm-libc-types.locale_t
.llvm-libc-types.size_t
.llvm_libc_common_h
)
add_header_macro(

View File

@@ -2,8 +2,7 @@ add_header(off64_t HDR off64_t.h)
add_header(size_t HDR size_t.h)
add_header(ssize_t HDR ssize_t.h)
add_header(__atfork_callback_t HDR __atfork_callback_t.h)
add_header(__bsearchcompare_t HDR __bsearchcompare_t.h)
add_header(__lsearchcompare_t HDR __lsearchcompare_t.h)
add_header(__search_compare_t HDR __search_compare_t.h)
add_header(__call_once_func_t HDR __call_once_func_t.h)
add_header(__dl_iterate_phdr_callback_t HDR __dl_iterate_phdr_callback_t.h DEPENDS .size_t)
add_header(__exec_argv_t HDR __exec_argv_t.h)

View File

@@ -1,14 +0,0 @@
//===-- Definition of type __lsearchcompare_t -----------------------------===//
//
// 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___LSEARCHCOMPARE_T_H
#define LLVM_LIBC_TYPES___LSEARCHCOMPARE_T_H
typedef int (*__lsearchcompare_t)(const void *, const void *);
#endif // LLVM_LIBC_TYPES___LSEARCHCOMPARE_T_H

View File

@@ -1,4 +1,4 @@
//===-- Definition of type __bsearchcompare_t -----------------------------===//
//===-- Definition of type __search_compare_t -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_TYPES___BSEARCHCOMPARE_T_H
#define LLVM_LIBC_TYPES___BSEARCHCOMPARE_T_H
#ifndef LLVM_LIBC_TYPES___SEARCH_COMPARE_T_H
#define LLVM_LIBC_TYPES___SEARCH_COMPARE_T_H
typedef int (*__bsearchcompare_t)(const void *, const void *);
typedef int (*__search_compare_t)(const void *, const void *);
#endif // LLVM_LIBC_TYPES___BSEARCHCOMPARE_T_H
#endif // LLVM_LIBC_TYPES___SEARCH_COMPARE_T_H

View File

@@ -2,11 +2,11 @@ header: search.h
header_template: search.h.def
macros: []
types:
- type_name: struct_hsearch_data
- type_name: ENTRY
- type_name: ACTION
- type_name: ENTRY
- type_name: VISIT
- type_name: __lsearchcompare_t
- type_name: __search_compare_t
- type_name: struct_hsearch_data
enums: []
objects: []
functions:
@@ -69,7 +69,7 @@ functions:
- type: const void *
- type: size_t *
- type: size_t
- type: __lsearchcompare_t
- type: __search_compare_t
- name: lsearch
standards:
- POSIX
@@ -79,4 +79,4 @@ functions:
- type: void *
- type: size_t *
- type: size_t
- type: __lsearchcompare_t
- type: __search_compare_t

View File

@@ -7,9 +7,9 @@ merge_yaml_files:
macros: []
types:
- type_name: __atexithandler_t
- type_name: __qsortrcompare_t
- type_name: __qsortcompare_t
- type_name: __bsearchcompare_t
- type_name: __qsortrcompare_t
- type_name: __search_compare_t
- type_name: div_t
- type_name: ldiv_t
- type_name: lldiv_t
@@ -87,7 +87,7 @@ functions:
- type: const void *
- type: size_t
- type: size_t
- type: __bsearchcompare_t
- type: __search_compare_t
- name: div
standards:
- stdc