-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
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.
@llvm/pr-subscribers-libcxx Author: Martin Storsjö (mstorsjo) ChangesThis 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:
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;
|
There was a problem hiding this 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!
/cherry-pick 91526d6 |
…#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)
/pull-request #89894 |
…#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)
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.