Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions libc/hdr/types/ACTION.h
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions libc/hdr/types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 2 additions & 0 deletions libc/src/search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libc/src/search/hsearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion libc/src/search/hsearch_r.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading