keep conditional compilation local

This commit is contained in:
Folkert 2022-12-24 19:37:13 +01:00
parent 26e5ac85d4
commit a2c760aa56
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 18 additions and 26 deletions

View file

@ -27,7 +27,7 @@ pub fn host_wasm_tempfile() -> std::io::Result<NamedTempFile> {
}
#[cfg(unix)]
pub fn host_unix_tempfile() -> std::io::Result<NamedTempFile> {
fn host_unix_tempfile() -> std::io::Result<NamedTempFile> {
let tempfile = tempfile::Builder::new()
.prefix("host_bitcode")
.suffix(".o")
@ -40,7 +40,7 @@ pub fn host_unix_tempfile() -> std::io::Result<NamedTempFile> {
}
#[cfg(windows)]
pub fn host_windows_tempfile() -> std::io::Result<NamedTempFile> {
fn host_windows_tempfile() -> std::io::Result<NamedTempFile> {
let tempfile = tempfile::Builder::new()
.prefix("host_bitcode")
.suffix(".obj")
@ -52,6 +52,18 @@ pub fn host_windows_tempfile() -> std::io::Result<NamedTempFile> {
Ok(tempfile)
}
pub fn host_tempfile() -> std::io::Result<NamedTempFile> {
#[cfg(unix)]
{
host_unix_tempfile()
}
#[cfg(windows)]
{
host_windows_tempfile()
}
}
#[derive(Debug, Default, Copy, Clone)]
pub struct IntrinsicName {
pub options: [&'static str; 14],