https://github.com/compnerd/swift-platform-core
Currency types for cross-platform support in Swift
https://github.com/compnerd/swift-platform-core
Last synced: 8 months ago
JSON representation
Currency types for cross-platform support in Swift
- Host: GitHub
- URL: https://github.com/compnerd/swift-platform-core
- Owner: compnerd
- License: bsd-3-clause
- Created: 2025-07-25T23:16:16.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-10-07T05:04:33.000Z (8 months ago)
- Last Synced: 2025-10-07T07:08:09.744Z (8 months ago)
- Language: Swift
- Homepage:
- Size: 12.7 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# swift-platform-core
A Swift library providing access to low-level system APIs across Windows, macOS, and Linux platforms.
## Features
- Type-safe wrappers around system APIs
- Cross-platform system information
- Platform-specific error handling
- Modular design with separate Windows and POSIX modules
## Usage
### Cross-Platform System Information
```swift
import POSIXCore // macOS, Linux
import WindowsCore // Windows
let pageSize = SystemInfo.PageSize
```
### Error Handling
```swift
// POSIX platforms
guard ... else {
throw POSIXError() // implicitly captures `errno`
}
// Windows platform
guard ... else {
throw WindowsError() // implicitly captures 'GetlastError()`
}
```
## Requirements
- Swift 6.0+
- Platforms:
- Windows 10+
- macOS 10.15+
- Linux
## Modules
- **POSIXCore** - macOS and Linux support
- POSIX API constants
- POSIX error wrapper
- **WindowsCore** - Windows support
- Win32 API constants
- Windows error wrapper
- NT API function accessors
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.