Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libcxx] [modules] Add _LIBCPP_USING_IF_EXISTS on aligned_alloc #89827

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

mstorsjo
Copy link
Member

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 a9c9183), but the modules seem to only have _LIBCPP_USING_IF_EXISTS set on a few individual functions.

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
a9c9183), but the modules seem
to only have _LIBCPP_USING_IF_EXISTS set on a few individual
functions.
@mstorsjo mstorsjo requested a review from mordante April 23, 2024 20:49
@mstorsjo mstorsjo requested a review from a team as a code owner April 23, 2024 20:49
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Apr 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 23, 2024

@llvm/pr-subscribers-libcxx

Author: Martin Storsjö (mstorsjo)

Changes

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 a9c9183), but the modules seem to only have _LIBCPP_USING_IF_EXISTS set on a few individual functions.


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

1 Files Affected:

  • (modified) libcxx/modules/std.compat/cstdlib.inc (+1-1)
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;

Copy link
Member

@mordante mordante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Great to hear!

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

I probably should properly propagate all of these to the modules.
(I'll add this to my todo list.) That should not block this patch, so LGTM!

@mstorsjo mstorsjo merged commit 91526d6 into llvm:main Apr 24, 2024
54 checks passed
@mstorsjo mstorsjo deleted the libcxx-modules-using-if-exists branch April 24, 2024 08:45
@mstorsjo mstorsjo added this to the LLVM 18.X Release milestone Apr 24, 2024
@mstorsjo
Copy link
Member Author

/cherry-pick 91526d6

llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Apr 24, 2024
…#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
a9c9183), but the modules seem to only
have _LIBCPP_USING_IF_EXISTS set on a few individual functions, so far.

(cherry picked from commit 91526d6)
@llvmbot
Copy link
Member

llvmbot commented Apr 24, 2024

/pull-request #89894

tstellar pushed a commit to llvmbot/llvm-project that referenced this pull request Apr 25, 2024
…#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
a9c9183), but the modules seem to only
have _LIBCPP_USING_IF_EXISTS set on a few individual functions, so far.

(cherry picked from commit 91526d6)
@pointhex pointhex mentioned this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants