https://github.com/swiftlang/swift-foundation/pull/975 started to
restrict the fallback value for `TZDIR` and it revealed that WASI
platform implicitly depends on TZDIR even though it won't have such
directory. This patch explicitly handles the case for WASI platform for
timezone operations.
* [Android] Enable more code and tests
while disabling setting extended file attributes and a test creating a hard link,
features not normally allowed on Android.
* Remove incorrect WASI check
* Get FoundationEssentials building
Adding the missing musl imports to get FoundationEssentials building for
the Swift static SDKs again.
Also providing an option to disable building the macros. The macros
aren't necessary for building the library and will not be run as part of
the static SDK. No need to bloat the SDK or build times further. For
Swift 6, the macros should be provided by the toolchain since the
toolchain and SDK are current revlocked due to swiftmodules.
* Get FoundationInternationalization building
Adding the missing Musl imports to get FoundationInternationalization
building for the static SDK.
* Use dynamic replacement instead of _typeByName for internationalization upcalls
* Make FOUNDATION_FRAMEWORK function non-dynamic
* Fix build failures
This adds the necessary guards and includes for the Android modules.
While the module does not compile currently due to nullability
differences (and in some cases missing declarations), this at least
brings the module to a point where we can start working on the errors
and differences to create a maintainable codebase for Android.
Use the Windows POSIX API spellings to avoid the warnings. Take the
opportunity to change the environment handling to ensure that we are
able to handle weird unicode environment variables which may not be
rendered properly in the ASCII environment representation. Adjust some
types to better match the implementation on Windows which is a minor uop
to avoid unnecessary `trunc` and `sext` or `zext`.
This allows for us to use the constants without explicitly casting the
type to `DWORD` on each site of use. By providing the shadowing
overload we can simply use the constants without impacting the
readability of the surrounding code.
* Provide public access for some internal functions, to enable swift-corelibs-foundation
* Add access to TimeZone internals for swift-corelibs-foundation
* Fix default TimeZone for Linux
* Remove unneeded private entry point
* Do not use a recursive definition of description for String.Encoding
* Merge in some WASI changes and other Data fixes
* Add temporary initializer to the stub URL
* Remove Hashable conformance for CocoaError. This allows userInfo to be Any instead of AnyHashable
* Remove some protocols which depend on NSError from swift-foundation -- they will live in swift-corelibs-foundation
* Adjust the debug description of the GMT ICU calendar to be a little less implementation-specific
* Use an English-only description for string encodings, for compatibility with existing SCL-F clients
* Use a more compatible definition of a backstop value for Bundle
Currently we implement adding units larger than `.day` as follows:
- Convert the date to date components
- Update the value of the added component
- Convert the date components back to date
The time of the day information is reduced to a `DateComponents` with, e.g. `hour == 1`, `minute == 30`, at step 1. Then when we convert the `DateComponents` back to `Date` at step 3, we always use the *first* occurrence of the time if it falls into the DST repeated time frame.
This is different from `Calendar_ICU`'s implementation, which uses the *latter* and rewind back the date by the DST transition interval (e.g. 1 hour for Pacific Time).
These yeild the same result except for when the input time and the output time are *both* during DST transition time frame. Update the implementation to match Calendar_ICU's behavior.
* [GregorianCalendar] Implement TimeZone support for `date(from components: DateComponents)`
To support DST-observing time zone, add a helper function for TimeZone to return the raw offset and DST offset individually so we can fine tune the behavior for the time during the skipped time frame and the repeated time frame.
* remove an accidental import
* Add non-compatibility tests
* Review feedback: Remove mention of "GMT" in the date argument
* Review feedback: Change the returning type of DST offset from Int to TimeInterval to be consistent with the existing dstOffset API
* Implement the required function for _TimeZoneBridged
* Fix a missing import
Update the Windows path for `String.range(of:)` being altered to
`String._range(of:anchored:backwards:)`. This repairs the build of
FoundationEssentials on Windows.
* Follow up for #278 : make the required function from FoundationEssentials `package` so we can use it from FoundationI18n
* Workaround TAPI error by removing the default arguments