[libc-commits] [libc] [libc] Add proxy header for the stack_t type (PR #107559)

via libc-commits libc-commits at lists.llvm.org
Fri Sep 6 03:40:23 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: wldfngrs (wldfngrs)

<details>
<summary>Changes</summary>

added proxy header for the stack_t type and modified the corresponding CMakeLists.txt files

---
Full diff: https://github.com/llvm/llvm-project/pull/107559.diff


3 Files Affected:

- (modified) libc/hdr/types/CMakeLists.txt (+9) 
- (added) libc/hdr/types/stack_t.h (+23) 
- (modified) libc/src/signal/sigaltstack.h (+1-1) 


``````````diff
diff --git a/libc/hdr/types/CMakeLists.txt b/libc/hdr/types/CMakeLists.txt
index ea7bbccffbb819..fdd8b3fea665a8 100644
--- a/libc/hdr/types/CMakeLists.txt
+++ b/libc/hdr/types/CMakeLists.txt
@@ -181,3 +181,12 @@ add_proxy_header_library(
     libc.include.signal
 )
 
+add_proxy_header_library(
+  stack_t
+  HDRS
+    stack_t
+  FULL_BUILD_DEPENDS
+    libc.include.llvm-libc-types.stack_t
+    libc.include.signal
+)
+
diff --git a/libc/hdr/types/stack_t.h b/libc/hdr/types/stack_t.h
new file mode 100644
index 00000000000000..88dd41d07d747f
--- /dev/null
+++ b/libc/hdr/types/stack_t.h
@@ -0,0 +1,23 @@
+//===-- Definition of macros from stack_t.h -------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https:llvm.or/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_HDR_STACK_T_H
+#define LLVM_LIBC_HDR_STACK_T_H
+
+#ifdef LIBC_FULL_BUILD
+
+#include "include/llvm-libc-types/stack_t.h"
+
+#else // overlay mode
+
+#include <signal.h>
+
+#endif // LLVM_LIBC_FULL_BUILD
+
+#endif // LLVM_LIBC_HDR_TYPES_STACK_T_H
diff --git a/libc/src/signal/sigaltstack.h b/libc/src/signal/sigaltstack.h
index fc6ec356e5ef86..7a82c0ee997118 100644
--- a/libc/src/signal/sigaltstack.h
+++ b/libc/src/signal/sigaltstack.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_SIGNAL_SIGALTSTACK_H
 #define LLVM_LIBC_SRC_SIGNAL_SIGALTSTACK_H
 
+#include "hdr/types/stack_t.h"
 #include "src/__support/macros/config.h"
-#include <signal.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/107559


More information about the libc-commits mailing list