-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Refactor the CFTimeZone initialization #2017
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 |
@swift-ci please test |
65157df
to
25097d5
Compare
millenomi
reviewed
Mar 18, 2019
891ef8c
to
635169b
Compare
@swift-ci please test |
Use an early return to reduce indentation. NFC.
Extract the initializing body of the function into a helper. This helps reduce the overall amount of code in the function, and more importantly makes it easier to improve support for Windows.
Remove the unnecessary condition which is always set to true.
Move the plist into a Windows resource file. This cleans up the code path and makes it easier to work with.
In order to accept the full Unicode supported Olson names, we need the inverted database for mapping the olson name to the Windows timezone. This plist provides that mapping derived from the Unicode CLDR data. This will permit us to support CFTimeZone creation on Windows.
Since Windows uses its own names for timezones, the Unicode corsotium provides the canonical mapping for the timezones. Use the Unicode CLDR to generate the mapping plist requires transformation, which this XSLT provides. These XSLs allow the creation of both the Olson -> Windows mapping and the Windows -> Olson mapping. Since the latter only preserves the primary name and not the secondary ones, we split the inverted database.
This queries the timezone information from the registry on Windows to create and initialize the timezone. This should allow CFTimeZoneCreate to function. Doing this will finally allow Foundation to use timezones on Windows!
These are source files as far as the CoreFoundation build is concerned. Add a dependency on the files.
This was adding a spurious `-I` to the compile flags which resulted in the output being placed incorrectly. Simply elide the flags for RC targets.
@swift-ci please test |
@swift-ci please test and merge |
1 similar comment
@swift-ci please test and merge |
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.
Refactor the initialization codepath a bit to make it more obvious how to modify this to support Windows and alter to query the information from the system.