[libcxx-commits] [libcxx] [libc++][modules] Add using_if_exists attribute (#77559) (PR #78909)

Gareth Williamson via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 21 11:45:31 PST 2024


https://github.com/gwllx created https://github.com/llvm/llvm-project/pull/78909

libc on macOS does not provide at_quick_exit or quick_exit. This allows modules to build on macOS and defer any errors to usage site of these symbols.

CC: @mordante 

>From c67b20e7bdc225bf2e52ec6f63ca1fb159fc8fa6 Mon Sep 17 00:00:00 2001
From: Gareth Williamson <gwllx.dev at gmail.com>
Date: Sun, 21 Jan 2024 20:32:21 +0100
Subject: [PATCH] [libc++][modules] Add using_if_exists attribute (#77559)

libc on macOS does not provide at_quick_exit or quick_exit. This allows
modules to build on macOS and defer any errors to usage site of these
symbols.
---
 libcxx/modules/std.compat/cstdlib.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcxx/modules/std.compat/cstdlib.inc b/libcxx/modules/std.compat/cstdlib.inc
index 9333d848707103d..a45a0a1caf8ba9a 100644
--- a/libcxx/modules/std.compat/cstdlib.inc
+++ b/libcxx/modules/std.compat/cstdlib.inc
@@ -16,10 +16,10 @@ export {
   // [support.start.term], start and termination
   using ::_Exit;
   using ::abort;
-  using ::at_quick_exit;
+  using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
   using ::atexit;
   using ::exit;
-  using ::quick_exit;
+  using ::quick_exit _LIBCPP_USING_IF_EXISTS;
 
   using ::getenv;
   using ::system;



More information about the libcxx-commits mailing list