[libc] Add proxy header for ACTION type. (#139796)

https://github.com/llvm/llvm-project/issues/139561
This commit is contained in:
lntue 2025-05-13 17:50:02 -04:00 committed by GitHub
parent 76dba2ea02
commit 79e8e27bfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 36 additions and 2 deletions

22
libc/hdr/types/ACTION.h Normal file
View File

@ -0,0 +1,22 @@
//===-- Proxy header for ACTION -------------------------------------------===//
//
// 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_HDR_TYPES_ACTION_H
#define LLVM_LIBC_HDR_TYPES_ACTION_H
#ifdef LIBC_FULL_BUILD
#include "include/llvm-libc-types/ACTION.h"
#else // Overlay mode
#include <search.h>
#endif // LLVM_LIBC_FULL_BUILD
#endif // LLVM_LIBC_HDR_TYPES_ACTION_H

View File

@ -383,3 +383,12 @@ add_proxy_header_library(
libc.include.llvm-libc-types.ENTRY
libc.include.search
)
add_proxy_header_library(
ACTION
HDRS
ACTION.h
FULL_BUILD_DEPENDS
libc.include.llvm-libc-types.ACTION
libc.include.search
)

View File

@ -34,6 +34,7 @@ add_entrypoint_object(
HDRS
hsearch.h
DEPENDS
libc.hdr.types.ACTION
libc.hdr.types.ENTRY
libc.src.search.hsearch.global
libc.src.__support.HashTable.table
@ -48,6 +49,7 @@ add_entrypoint_object(
HDRS
hsearch_r.h
DEPENDS
libc.hdr.types.ACTION
libc.hdr.types.ENTRY
libc.src.__support.HashTable.table
libc.src.errno.errno

View File

@ -9,9 +9,9 @@
#ifndef LLVM_LIBC_SRC_SEARCH_HSEARCH_H
#define LLVM_LIBC_SRC_SEARCH_HSEARCH_H
#include "hdr/types/ACTION.h"
#include "hdr/types/ENTRY.h"
#include "src/__support/macros/config.h"
#include <search.h> // ACTION
namespace LIBC_NAMESPACE_DECL {
ENTRY *hsearch(ENTRY item, ACTION action);

View File

@ -9,9 +9,10 @@
#ifndef LLVM_LIBC_SRC_SEARCH_HSEARCH_R_H
#define LLVM_LIBC_SRC_SEARCH_HSEARCH_R_H
#include "hdr/types/ACTION.h"
#include "hdr/types/ENTRY.h"
#include "src/__support/macros/config.h"
#include <search.h> // ACTION
#include <search.h> // hsearch_data
namespace LIBC_NAMESPACE_DECL {
int hsearch_r(ENTRY item, ACTION action, ENTRY **retval,