Skip to content

Commit

Permalink
Add basic support for other Apple platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
complexspaces committed Nov 1, 2024
1 parent 5e3ed81 commit b0a0771
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A small and lightweight Rust library to get the current active locale on the sys

Platform support currently includes:
- Android
- iOS
- iOS (and derivatives such as watchOS, tvOS, and visionOS)
- macOS
- Linux, BSD, and other UNIX variations
- WebAssembly, for the following platforms:
Expand Down
26 changes: 6 additions & 20 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@
//!
//! This library currently supports the following platforms:
//! - Android
//! - iOS
//! - iOS (and derivatives such as watchOS, tvOS, and visionOS)
//! - macOS
//! - Linux, BSD, and other UNIX variations
//! - WebAssembly on the web (via the `js` feature)
//! - Windows
#![cfg_attr(
any(
not(unix),
target_os = "macos",
target_os = "ios",
target_os = "android"
),
no_std
)]
#![cfg_attr(any(not(unix), target_vendor = "apple", target_os = "android"), no_std)]
extern crate alloc;
use alloc::string::String;

Expand All @@ -24,20 +16,14 @@ mod android;
#[cfg(target_os = "android")]
use android as provider;

#[cfg(any(target_os = "macos", target_os = "ios"))]
#[cfg(target_vendor = "apple")]
mod apple;
#[cfg(any(target_os = "macos", target_os = "ios"))]
#[cfg(target_vendor = "apple")]
use apple as provider;

#[cfg(all(
unix,
not(any(target_os = "macos", target_os = "ios", target_os = "android"))
))]
#[cfg(all(unix, not(any(target_vendor = "apple", target_os = "android"))))]
mod unix;
#[cfg(all(
unix,
not(any(target_os = "macos", target_os = "ios", target_os = "android"))
))]
#[cfg(all(unix, not(any(target_vendor = "apple", target_os = "android"))))]
use unix as provider;

#[cfg(all(target_family = "wasm", feature = "js", not(unix)))]
Expand Down

0 comments on commit b0a0771

Please sign in to comment.