#[cfg(target_os = "macos")]
mod macos;
#[cfg(target_os = "macos")]
use macos as platform;
#[cfg(target_os = "windows")]
mod windows;
#[cfg(target_os = "windows")]
use windows as platform;
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "linux")]
use linux as platform;
#[cfg(any(target_os = "ios", target_os = "tvos", target_os = "visionos", target_os = "watchos"))]
mod apple_mobile;
#[cfg(any(
target_os = "ios",
target_os = "tvos",
target_os = "visionos",
target_os = "watchos"
))]
use apple_mobile as platform;
#[cfg(target_os = "android")]
pub mod android;
#[cfg(target_os = "android")]
use android as platform;
use crate::{DeviceInfo, DeviceInfoError};
pub fn device_info() -> Result<DeviceInfo, DeviceInfoError> {
#[cfg(any(
target_os = "macos",
target_os = "windows",
target_os = "linux",
target_os = "ios",
target_os = "tvos",
target_os = "visionos",
target_os = "watchos",
target_os = "android",
))]
{
platform::device_info()
}
#[cfg(not(any(
target_os = "macos",
target_os = "windows",
target_os = "linux",
target_os = "ios",
target_os = "tvos",
target_os = "visionos",
target_os = "watchos",
target_os = "android",
)))]
{
Err(DeviceInfoError::Unsupported)
}
}