-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[libc++] Fix C++23 standard modules when using with clang-cl
on Windows
#148992
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -14,15 +14,17 @@ export { | |||||||||||||||||
|
||||||||||||||||||
using ::timespec _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::tm _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
|
||||||||||||||||||
using ::asctime _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::clock _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::strftime _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
|
||||||||||||||||||
#ifndef _LIBCPP_ABI_VCRUNTIME | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you simply leaving these functions missing when using UCRT? Also, it seem that we should modify this line
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm looking into it, however it seems that moving the definition '_BUILD_STD_MODULE' triggered some other weird errors, I'll do more testing tomorrow and see... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aha, these lines should be removed. Now Lines 11 to 17 in 653872f
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like just defining the macro is not enough, I have resorted to defining the actual functions as inline, I'll push the changes once I made sure that everything works with both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||||||||||||||||||
using ::ctime _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::difftime _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::gmtime _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::localtime _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::mktime _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::strftime _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::time _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
using ::timespec_get _LIBCPP_USING_IF_EXISTS; | ||||||||||||||||||
#endif | ||||||||||||||||||
} // export |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,10 @@ | |
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifdef _LIBCPP_ABI_VCRUNTIME | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this change is temporary? |
||
#define _BUILD_STD_MODULE | ||
#endif | ||
|
||
// WARNING, this entire header is generated by | ||
// utils/generate_libcxx_cppm_in.py | ||
// DO NOT MODIFY! | ||
|
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.
How does the MSVC STL get their own definition for
get_new_handler()
? It seems really brittle to include<new.h>
but have our definition forget_new_handler()
. We should either declare all of them (set_new_handler()
, thenew_handler
alias, etc) or rely on<new.h>
to provide them, but not a mixture of both.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.
MSVC STL just (additionally) declares it in
<new>
. The declaration is not available from<new.h>
or<vcruntime_new.h>
.