This commit is contained in:
Max Brunsfeld 2022-09-26 15:23:10 -07:00
parent 4784dbe498
commit da36eb3b41
4 changed files with 67 additions and 33 deletions

View file

@ -69,6 +69,7 @@ pub trait Platform: Send + Sync {
fn path_for_auxiliary_executable(&self, name: &str) -> Result<PathBuf>;
fn app_path(&self) -> Result<PathBuf>;
fn app_version(&self) -> Result<AppVersion>;
fn os_name(&self) -> &'static str;
fn os_version(&self) -> Result<AppVersion>;
}

View file

@ -750,6 +750,10 @@ impl platform::Platform for MacPlatform {
}
}
fn os_name(&self) -> &'static str {
"macOS"
}
fn os_version(&self) -> Result<crate::AppVersion> {
unsafe {
let process_info = NSProcessInfo::processInfo(nil);

View file

@ -197,6 +197,10 @@ impl super::Platform for Platform {
})
}
fn os_name(&self) -> &'static str {
"test"
}
fn os_version(&self) -> Result<AppVersion> {
Ok(AppVersion {
major: 1,