mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-23 14:35:12 +00:00
keep conditional compilation local
This commit is contained in:
parent
26e5ac85d4
commit
a2c760aa56
3 changed files with 18 additions and 26 deletions
|
@ -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],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue