0.2.3: bug fix extern length symbol
This commit is contained in:
@@ -27,9 +27,7 @@ OUTPUT OPTIONS:
|
||||
--constexpr Whether the symbol should be marked as constexpr (C++ mode)
|
||||
|
||||
--symname NAME Symbol name
|
||||
--namespace NAME Namespace in which the symbol will exist
|
||||
(uses namespace example {} in C++ mode and prepends
|
||||
EXAMPLE_ to symbol names in C mode)
|
||||
--namespace NAME Namespace in which the symbol will exist (C++ mode)
|
||||
--guard NAME Preprocessor macro to use for the header guard (#ifndef ...)
|
||||
(default: derive from output filename)
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ pub fn with_contents(
|
||||
|
||||
with_definition(config, in_data, buf)?;
|
||||
write!(buf, "#else{}", config.line_ending).unwrap();
|
||||
with_includes(config, 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 {
|
||||
ContainerType::CArray(_) => {
|
||||
write!(
|
||||
buf,
|
||||
"{}{};{}",
|
||||
modifiers,
|
||||
length_data_type_symbol(config),
|
||||
config.line_ending
|
||||
)
|
||||
.unwrap();
|
||||
write!(buf, "{}{};{}", modifiers, in_data.len(), config.line_ending).unwrap();
|
||||
}
|
||||
ContainerType::CString => {
|
||||
write!(
|
||||
buf,
|
||||
"{}{};{}",
|
||||
modifiers,
|
||||
length_data_type_symbol(config),
|
||||
in_data.len() + 1,
|
||||
config.line_ending
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user