Skip to content

Commit de6258f

Browse files
authored
Merge pull request #14 from parasyte/fix/non-x86
Fix build on non-x86 platforms
2 parents 7cd9212 + d9b680d commit de6258f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

native/src/bench.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::{
33
time::{Duration, Instant},
44
};
55

6+
#[cfg(target_arch = "x86_64")]
67
use gameroy_jit::CompilerOpts;
78
use gameroy_lib::gameroy::{
89
consts::CLOCK_SPEED,
@@ -42,6 +43,7 @@ fn print_val(val: f64, err: f64) -> String {
4243
format!("{:.p$} +/- {:.p$}", val, err, p = p)
4344
}
4445

46+
#[allow(unused_variables)]
4547
pub fn benchmark(
4648
Bench {
4749
rom_path: ref path,
@@ -109,9 +111,12 @@ pub fn benchmark(
109111
);
110112

111113
// Remove first run, because in that one the code is traced.
112-
times.remove(0);
114+
#[cfg(target_arch = "x86_64")]
115+
{
116+
times.remove(0);
113117

114-
print_stats(times, game_boy.clock_count - start_clock_count);
118+
print_stats(times, game_boy.clock_count - start_clock_count);
119+
}
115120
}
116121
}
117122

@@ -169,6 +174,7 @@ fn run_jitted(
169174
times
170175
}
171176

177+
#[cfg(target_arch = "x86_64")]
172178
#[inline(never)]
173179
fn pre_run(game_boy: &mut GameBoy, timeout: u64, jit_compiler: &mut gameroy_jit::JitCompiler) {
174180
game_boy.reset();

0 commit comments

Comments
 (0)