Okay I finally found the answer thanks to Eugene Sh.'s code:
use seq_macro::seq;
macro_rules! include_each {
($n:literal) => {
seq!(N in 0..$n {
[#(include_bytes!(stringify!(file~N)),)*]
})
};
}
const FRAME_SIZE: usize = 8;
static DATA: [&[u8; FRAME_SIZE]; 2] = include_each!(2);
Which I modified into this:
#[macro_export]
macro_rules! import_img_anim {
($path:literal, $n:literal, $extension:literal) => {
seq_macro::seq!(N in 1..=$n {
[#(include_bytes!(concat!($path, "/frame", stringify!(N), $extension)),)*]
})
};
}
The problem seemed to be this part of the code:
seq_macro::seq!(N in 1..=$n {
include_bytes!(concat!($path, "/frame", stringify!(N), ".png")),
})
Which just put the include_bytes!
macro there without anything else.
Thanks again Eugenne Sh.!