-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Export VCRuntime entities properly #4375
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
Changes from all commits
096ad57
9e7c285
5bd1e7d
e7f0445
748e6d8
dd9b6ee
22a372a
79a8d8a
ab78252
8f5f0af
5018d32
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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,6 +36,84 @@ export module std; | |||||||
| #pragma warning(push) | ||||||||
| #pragma warning(disable : 5244) // '#include <meow>' in the purview of module 'std' appears erroneous. | ||||||||
|
|
||||||||
| #include <yvals_core.h> | ||||||||
| #ifndef _VCRT_EXPORT_STD // TRANSITION, VCRuntime update expected in 17.10 Preview 3 | ||||||||
|
|
||||||||
| // N4971 [module.interface]/6: "A redeclaration of an entity X is implicitly exported | ||||||||
| // if X was introduced by an exported declaration; otherwise it shall not be exported." | ||||||||
|
|
||||||||
| // Therefore, we'll need to introduce exported declarations of <vcruntime_new.h> machinery before including it. | ||||||||
|
Contributor
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. Mega nitpick (not worth resetting testing):
Suggested change
Member
Author
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. Sure, I can handle this in a followup. This code is destined to be removed after the 17.10p3 toolset update anyways. |
||||||||
|
|
||||||||
| #pragma pack(push, _CRT_PACKING) | ||||||||
| #pragma warning(push, _STL_WARNING_LEVEL) | ||||||||
| #pragma warning(disable : _STL_DISABLED_WARNINGS) | ||||||||
| _STL_DISABLE_CLANG_WARNINGS | ||||||||
| #pragma push_macro("new") | ||||||||
| #undef new | ||||||||
|
|
||||||||
| _STD_BEGIN | ||||||||
| export extern "C++" struct nothrow_t; | ||||||||
|
|
||||||||
| export extern "C++" const nothrow_t nothrow; | ||||||||
|
|
||||||||
| #ifdef __cpp_aligned_new | ||||||||
| export extern "C++" enum class align_val_t : size_t; | ||||||||
|
Contributor
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
Member
Author
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. That's correct. |
||||||||
| #endif // ^^^ defined(__cpp_aligned_new) ^^^ | ||||||||
| _STD_END | ||||||||
|
|
||||||||
| export extern "C++" _NODISCARD _Ret_notnull_ _Post_writable_byte_size_(_Size) | ||||||||
| _VCRT_ALLOCATOR void* __CRTDECL operator new(size_t _Size); | ||||||||
| export extern "C++" _NODISCARD _Ret_maybenull_ _Success_(return != NULL) | ||||||||
| _Post_writable_byte_size_(_Size) _VCRT_ALLOCATOR void* __CRTDECL | ||||||||
| operator new(size_t _Size, const _STD nothrow_t&) noexcept; | ||||||||
| export extern "C++" _NODISCARD _Ret_notnull_ _Post_writable_byte_size_(_Size) | ||||||||
| _VCRT_ALLOCATOR void* __CRTDECL operator new[](size_t _Size); | ||||||||
| export extern "C++" _NODISCARD _Ret_maybenull_ _Success_(return != NULL) | ||||||||
| _Post_writable_byte_size_(_Size) _VCRT_ALLOCATOR void* __CRTDECL | ||||||||
| operator new[](size_t _Size, const _STD nothrow_t&) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete(void* _Block) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete(void* _Block, size_t _Size) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete(void* _Block, const _STD nothrow_t&) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete[](void* _Block) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete[](void* _Block, size_t _Size) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete[](void* _Block, const _STD nothrow_t&) noexcept; | ||||||||
|
|
||||||||
| #ifdef __cpp_aligned_new | ||||||||
| export extern "C++" _NODISCARD _Ret_notnull_ _Post_writable_byte_size_(_Size) | ||||||||
| _VCRT_ALLOCATOR void* __CRTDECL operator new(size_t _Size, _STD align_val_t _Al); | ||||||||
| export extern "C++" _NODISCARD _Ret_maybenull_ _Success_(return != NULL) | ||||||||
| _Post_writable_byte_size_(_Size) _VCRT_ALLOCATOR void* __CRTDECL | ||||||||
| operator new(size_t _Size, _STD align_val_t _Al, const _STD nothrow_t&) noexcept; | ||||||||
| export extern "C++" _NODISCARD _Ret_notnull_ _Post_writable_byte_size_(_Size) | ||||||||
| _VCRT_ALLOCATOR void* __CRTDECL operator new[](size_t _Size, _STD align_val_t _Al); | ||||||||
| export extern "C++" _NODISCARD _Ret_maybenull_ _Success_(return != NULL) | ||||||||
| _Post_writable_byte_size_(_Size) _VCRT_ALLOCATOR void* __CRTDECL | ||||||||
| operator new[](size_t _Size, _STD align_val_t _Al, const _STD nothrow_t&) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete(void* _Block, _STD align_val_t _Al) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete(void* _Block, size_t _Size, _STD align_val_t _Al) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete(void* _Block, _STD align_val_t _Al, const _STD nothrow_t&) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete[](void* _Block, _STD align_val_t _Al) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete[](void* _Block, size_t _Size, _STD align_val_t _Al) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete[]( | ||||||||
| void* _Block, _STD align_val_t _Al, const _STD nothrow_t&) noexcept; | ||||||||
| #endif // ^^^ defined(__cpp_aligned_new) ^^^ | ||||||||
|
|
||||||||
| export extern "C++" _NODISCARD _MSVC_CONSTEXPR _Ret_notnull_ _Post_writable_byte_size_(_Size) | ||||||||
| _Post_satisfies_(return == _Where) void* __CRTDECL | ||||||||
| operator new(size_t _Size, _Writable_bytes_(_Size) void* _Where) noexcept; | ||||||||
| export extern "C++" _NODISCARD _Ret_notnull_ _Post_writable_byte_size_(_Size) | ||||||||
| _Post_satisfies_(return == _Where) void* __CRTDECL | ||||||||
| operator new[](size_t _Size, _Writable_bytes_(_Size) void* _Where) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete(void*, void*) noexcept; | ||||||||
| export extern "C++" void __CRTDECL operator delete[](void*, void*) noexcept; | ||||||||
|
|
||||||||
| #pragma pop_macro("new") | ||||||||
| _STL_RESTORE_CLANG_WARNINGS | ||||||||
| #pragma warning(pop) | ||||||||
| #pragma pack(pop) | ||||||||
|
|
||||||||
| #endif // ^^^ workaround ^^^ | ||||||||
|
|
||||||||
| // "C++ library headers" [tab:headers.cpp] | ||||||||
| #include <algorithm> | ||||||||
| #if _HAS_STATIC_RTTI | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.