[llvm-branch-commits] [libcxx] b9b7381 - [libcxx] [modules] Add _LIBCPP_USING_IF_EXISTS on aligned_alloc (#89827)

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Apr 25 06:53:53 PDT 2024


Author: Martin Storsjö
Date: 2024-04-25T06:53:04-07:00
New Revision: b9b73814ad8acd55e88d0415f4110d272797697d

URL: https://github.com/llvm/llvm-project/commit/b9b73814ad8acd55e88d0415f4110d272797697d
DIFF: https://github.com/llvm/llvm-project/commit/b9b73814ad8acd55e88d0415f4110d272797697d.diff

LOG: [libcxx] [modules] Add _LIBCPP_USING_IF_EXISTS on aligned_alloc (#89827)

This is missing e.g. on Windows. With this change, it's possible to make
the libcxx std module work on mingw-w64 (although that requires a few
fixes to those headers).

In the regular cstdlib header, we have _LIBCPP_USING_IF_EXISTS flagged
on every single reexported function (since
a9c9183ca42629fa83cdda297d1d30c7bc1d7c91), but the modules seem to only
have _LIBCPP_USING_IF_EXISTS set on a few individual functions, so far.

(cherry picked from commit 91526d64a8adb14edc55adfd5270858791822837)

Added: 
    

Modified: 
    libcxx/modules/std.compat/cstdlib.inc

Removed: 
    


################################################################################
diff  --git a/libcxx/modules/std.compat/cstdlib.inc b/libcxx/modules/std.compat/cstdlib.inc
index a45a0a1caf8ba9..4783cbf5162390 100644
--- a/libcxx/modules/std.compat/cstdlib.inc
+++ b/libcxx/modules/std.compat/cstdlib.inc
@@ -25,7 +25,7 @@ export {
   using ::system;
 
   // [c.malloc], C library memory allocation
-  using ::aligned_alloc;
+  using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
   using ::calloc;
   using ::free;
   using ::malloc;


        


More information about the llvm-branch-commits mailing list