15 Commits

Author SHA1 Message Date
Johannes Weiss
601e847faa
always @preconcurrency import Glibc (#1175)
Co-authored-by: Johannes Weiss <johannes@jweiss.io>
2025-03-04 09:25:51 -08:00
Jeremy Schonfeld
4d0aad8cfe
[Windows] Include variant in file path errors (#1085) 2024-12-16 17:03:57 -08:00
Jeremy Schonfeld
6c0a3e8453
Performance optimizations for data reading/writing (#942)
* (135743158) Performance optimizations for data reading/writing

* Fix Windows build
2024-09-24 13:16:44 -07:00
finagolfin
c15a5e1f5c
[Android] Use the Bionic module in more places (#842)
Also, use `canImport()` wherever importing APIs, reserving `os(Android)` for
platform differences.
2024-08-15 14:34:15 -07:00
Evan Wilde
aecc1b158c
[main] Get Swift-Foundation building against MUSL for Swift Static SDK (#848)
* 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.
2024-08-14 13:34:15 -07:00
Yuta Saito
c82d1673eb
Add WASI platform conditions for libc imports and word size (#776)
* Add `import WASILibc` statements to libc import chains

* Declare wasm32 arch as 32-bit environment

* Switch to _pointerBitWidth for architecture checks

This change switches the architecture checks in Data.swift to use the
_pointerBitWidth instead of the arch() checks for consistency with newer
platforms.
2024-08-02 09:55:56 -07:00
Saleem Abdulrasool
a7692238a8
FoundationEssentials: initial pass to add Android support (#704)
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.
2024-06-26 16:00:37 -07:00
Jeremy Schonfeld
db2fb923e6
(129785296) Ensure EOPNOTSUPP thrown via Data reading from a socket does not crash (#695) 2024-06-21 16:06:41 -07:00
Saleem Abdulrasool
21ed596f06
FoundationEssentials: adjust error code thrown (#671)
Rather than relaying the underlying system error, replace the error with
the expected error code. This repairs the test case expectation of the
thrown error.
2024-06-12 08:37:16 -07:00
Jeremy Schonfeld
762698ea5e
(128609033) Avoid crashing due to malformed paths creating URLs (#646) 2024-05-31 13:50:26 -07:00
Saleem Abdulrasool
b80fb683b6
FoundationEssentials: provide typed overloads for constants from WinSDK
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.
2024-04-11 15:53:31 -07:00
Saleem Abdulrasool
059d1abb27
FoundationEssentials: introduce a new error domain for Windows (#528)
Introduce the new Win32 error domain and error type to allow us to
represent the underlying OS error for file system operations. This
prepares us for the necessary support in `FileManager`.
2024-04-04 18:24:24 -07:00
Jeremy Schonfeld
872c7e7fd2
(124302607) Path-based CocoaErrors should use both NSFilePathErrorKey and NSURLErrorKey 2024-03-13 10:50:02 -07:00
Jeremy Schonfeld
e5211f2926
(122981400) Standardize on using internal import 2024-03-06 13:42:02 -08:00
Jeremy Schonfeld
12d6069721
(123104044) Consolidate/standardize file-based error reporting
* Consolidate/standardize file-based error reporting

* Fix build failures

* Fix test failures
2024-02-16 16:50:16 -08:00