vlcrs-core: fourcc: Incorrect automatic bindings for FourCCs
This issue is created to track the error in MR !2738
error: expected one of `(`, `[`, or `{`, found `#`
--> vlcrs-core/src/fourcc.rs:243:5
|
243 | vlcrs_core_sys::fourcc_consts!();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected one of `(`, `[`, or `{`
| in this macro invocation
|
= note: this error originates in the macro `vlcrs_core_sys::fourcc_consts` (in Nightly builds, run with -Z macro-backtrace for more info)
The error is due to naive generation of FourCC constants from build.rs.
The generated output contains the below code snippet which is responsible for the error.
pub const VLC_CODEC_RGB565BE: FourCC = fourcc!('R','B','1','6');
pub const VLC_CODEC_RGB565LE: FourCC = fourcc!('R','V','1','6');
pub const VLC_CODEC_BGR565BE: FourCC = fourcc!('B','B','1','6');
pub const VLC_CODEC_BGR565LE: FourCC = fourcc!('B','L','1','6');
pub const VLC_CODEC_RGB565: FourCC = fourcc!#define VLC_CODEC_RGB565 VLC_CODEC_RGB565BE;
pub const VLC_CODEC_BGR565: FourCC = fourcc!#define VLC_CODEC_BGR565 VLC_CODEC_BGR565BE;
pub const VLC_CODEC_RGB565: FourCC = fourcc!#define VLC_CODEC_RGB565 VLC_CODEC_RGB565LE;
pub const VLC_CODEC_BGR565: FourCC = fourcc!#define VLC_CODEC_BGR565 VLC_CODEC_BGR565LE;
pub const VLC_CODEC_RGB555BE: FourCC = fourcc!('R','B','1','5');
pub const VLC_CODEC_RGB555LE: FourCC = fourcc!('R','V','1','5');
pub const VLC_CODEC_BGR555BE: FourCC = fourcc!('B','B','1','5');
pub const VLC_CODEC_BGR555LE: FourCC = fourcc!('B','L','1','5');
pub const VLC_CODEC_RGB555: FourCC = fourcc!#define VLC_CODEC_RGB555 VLC_CODEC_RGB555BE;
pub const VLC_CODEC_BGR555: FourCC = fourcc!#define VLC_CODEC_BGR555 VLC_CODEC_BGR555BE;
pub const VLC_CODEC_RGB555: FourCC = fourcc!#define VLC_CODEC_RGB555 VLC_CODEC_RGB555LE;
pub const VLC_CODEC_BGR555: FourCC = fourcc!#define VLC_CODEC_BGR555 VLC_CODEC_BGR555LE;
Also, it doesn't consider macro expansion based on the system endianness.