Skip to content

Commit 088dfcf

Browse files
committed
Wrap entries.rs in a top-level macro
1 parent 23bf43f commit 088dfcf

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

build.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::cell::RefCell;
88
use std::collections::BTreeMap;
99
use std::collections::BTreeSet;
1010
use std::env;
11-
use std::io::Read;
11+
use std::io::{Read, Write};
1212
use std::panic::AssertUnwindSafe;
1313
use std::path::{PathBuf, Path};
1414
use std::process::Command;
@@ -266,10 +266,11 @@ fn main() {
266266

267267
let output = generate(relevant);
268268
let mut file = std::fs::File::create(out_path.join("entries.rs")).unwrap();
269+
writeln!(file, "jit_entries!{{").unwrap();
269270
for line in output {
270-
use std::io::Write;
271-
writeln!(file, "{}", line).unwrap();
271+
writeln!(file, " {}", line).unwrap();
272272
}
273+
writeln!(file, "}}").unwrap();
273274

274275
// Write the bindings to the $OUT_DIR/bindings.rs file.
275276
bindings

src/raw.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,9 @@ macro_rules! jit_entry {
277277
};
278278
}
279279

280+
macro_rules! jit_entries {
281+
( $( $tokens:tt )* ) => { $( $tokens )* };
282+
}
283+
280284
include!(concat!(env!("OUT_DIR"), "/entries.rs"));
281285

0 commit comments

Comments
 (0)