-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Windows Port Continuation #1810
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
Merged
Merged
Conversation
This file contains hidden or 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
@swift-ci please test |
compnerd
commented
Dec 17, 2018
@@ -428,7 +428,7 @@ static __CFPortSet __CFPortSetAllocate(void) { | |||
result->used = 0; | |||
result->size = 4; | |||
result->handles = (HANDLE *)CFAllocatorAllocate(kCFAllocatorSystemDefault, result->size * sizeof(HANDLE), 0); | |||
CF_SPINLOCK_INIT_FOR_STRUCTS(result->lock); | |||
CF_LOCK_INIT_FOR_STRUCTS(result->lock); |
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.
Note that result->lock
is of type CFLock_t
on L415.
@swift-ci please test |
The previous error downgrade exposes the fact that the callback had a new parameter added that we did not provide on Windows. Provide a placeholder for now.
Windows does not have the same semantics for the thread clean up when using FLS (TLS does not support callbacks on destructor). Simply wipe out everything on attempt one.
Update the macro to `CF_LOCK_INIT_FOR_STRUCT`. This repairs the windows build.
The Windows TLS setup path is different from the POSIX path. Do not doubly define the TLS keys.
MessagePorts are a Mach feature and do not have an equivalent implementation on Windows. Remove the header inclusion.
@swift-ci please test |
Since the latter is more generic, permitting setting the name of a given thread rather than the current thread, re-implement `_NS_pthread_set_name` in terms of `_CFSetThreadName`.
Windows does not have POSIX threads. Provide an emulation stub for `pthread_equals` that uses the underlying Win32 APIs to compare the thread reference (HANDLE).
This is just a macro to use `GetCurrentThread` to get the current thread's handle much like `pthread_self`.
Reconcile the `CF_EXPORT` and `CF_CROSSPLATFORM_EXPORT` macro decorations. Fix a style issue where a symbol was being marked with `CF_EXPORT` in the definitions rather than the declaration which is not the intended use of the `CF_EXPORT` macro.
The thread handles are no longer structures, but raw Windows threading references (HANDLES). Adjust the macros accordingly.
The windows startup path is slightly different from Linux. Correct the references to the TSD initialization and teardown.
The parameter type was declared in the declaration making the type invisible to all other code as the type becomes anonymous. Forward declare the structure.
Pass the `-fcf-runtime-abi` flag via `/clang` to ensure that clang gets the flag. This also avoids CMake's annoying deduplication of flags which prevent the use of `-Xclang`.
The dependencies should be shared, avoid the search and just pass long the variables to the sub-configure.
On Windows, `CFLock_t` is already an unfair lock. Simply add some macros to use `CFLock_t` on Windows as it is not as lightweight on Darwin.
@swift-ci please test |
@parkera - is this okay to merge? |
parkera
approved these changes
Dec 21, 2018
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.
Peel off another 2 changes from the Windows port stack.