0.2.3: bug fix extern length symbol
This commit is contained in:
parent
4d3f31cdc4
commit
484062b64a
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -4,7 +4,7 @@ version = 4
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bin2hpp"
|
name = "bin2hpp"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "bin2hpp"
|
name = "bin2hpp"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
authors = ["Adam Macdonald"]
|
authors = ["Adam Macdonald"]
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "GPL-3.0-only"
|
license = "GPL-3.0-only"
|
||||||
|
@ -27,9 +27,7 @@ OUTPUT OPTIONS:
|
|||||||
--constexpr Whether the symbol should be marked as constexpr (C++ mode)
|
--constexpr Whether the symbol should be marked as constexpr (C++ mode)
|
||||||
|
|
||||||
--symname NAME Symbol name
|
--symname NAME Symbol name
|
||||||
--namespace NAME Namespace in which the symbol will exist
|
--namespace NAME Namespace in which the symbol will exist (C++ mode)
|
||||||
(uses namespace example {} in C++ mode and prepends
|
|
||||||
EXAMPLE_ to symbol names in C mode)
|
|
||||||
--guard NAME Preprocessor macro to use for the header guard (#ifndef ...)
|
--guard NAME Preprocessor macro to use for the header guard (#ifndef ...)
|
||||||
(default: derive from output filename)
|
(default: derive from output filename)
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ pub fn with_contents(
|
|||||||
|
|
||||||
with_definition(config, in_data, buf)?;
|
with_definition(config, in_data, buf)?;
|
||||||
write!(buf, "#else{}", config.line_ending).unwrap();
|
write!(buf, "#else{}", config.line_ending).unwrap();
|
||||||
|
with_includes(config, buf);
|
||||||
with_declaration(config, in_data, buf);
|
with_declaration(config, in_data, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,21 +206,14 @@ pub fn with_declaration(config: &Config, in_data: &[u8], buf: &mut String) {
|
|||||||
|
|
||||||
match config.container_type {
|
match config.container_type {
|
||||||
ContainerType::CArray(_) => {
|
ContainerType::CArray(_) => {
|
||||||
write!(
|
write!(buf, "{}{};{}", modifiers, in_data.len(), config.line_ending).unwrap();
|
||||||
buf,
|
|
||||||
"{}{};{}",
|
|
||||||
modifiers,
|
|
||||||
length_data_type_symbol(config),
|
|
||||||
config.line_ending
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
ContainerType::CString => {
|
ContainerType::CString => {
|
||||||
write!(
|
write!(
|
||||||
buf,
|
buf,
|
||||||
"{}{};{}",
|
"{}{};{}",
|
||||||
modifiers,
|
modifiers,
|
||||||
length_data_type_symbol(config),
|
in_data.len() + 1,
|
||||||
config.line_ending
|
config.line_ending
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user