-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Various cleanups: extern "C"
#4143
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It doesn't really matter because typedefs are "transparent" (they don't create new types), but I believe it's desirable for the signatures of extern "C" functions to restrict themselves to mentioning only things that are within the extern "C" universe. During the initial modularization effort, I overhauled extern "C" functions to mention only extern "C" structs, where it did matter.
Again, it doesn't really matter for typedefs, but this is now consistent with stl/inc/xthreads.h.
I am a greedy kitty who's speculatively mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
CaseyCarter
approved these changes
Nov 6, 2023
I've pushed a merge with |
This was referenced Nov 7, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've accumulated inconsistency between using our
_EXTERN_C
macro and directly sayingextern "C"
:STL/stl/inc/memory
Lines 3720 to 3723 in f392449
STL/stl/inc/__msvc_sanitizer_annotate_container.hpp
Lines 131 to 134 in f392449
The macro used to be important when some of our headers were dual C and C++. Now that they're always C++, and that we don't expect to play special games with
extern "C"
in the foreseeable future, we should resolve this inconsistency and favor dropping the macro.(In contrast, we're quite disciplined about
_STD_BEGIN
in product code, and I do want to play special games with it soon.)_EXTERN_C ... _END_EXTERN_C
=>extern "C" { ... } // extern "C"
// extern "C"
comments.stacktrace
's function pointer typedefs inextern "C"
.extern "C"
functions to restrict themselves to mentioning only things that are within theextern "C"
universe. During the initial modularization effort, I overhauledextern "C"
functions to mention onlyextern "C"
structs, where it did matter.sharedmutex.cpp
: Move the_Smtx_t
typedef withinextern "C"
.stl/inc/xthreads.h
:STL/stl/inc/xthreads.h
Lines 21 to 28 in f392449
_Atomic_memory_order_meow
asextern "C"
to match vcruntime._C_meow_complex
asextern "C"
to match the UCRT.