diff --git a/Common.pm b/Common.pm index 3e11badbf..c7fbccec0 100644 --- a/Common.pm +++ b/Common.pm @@ -177,13 +177,14 @@ my @primitive_type_list = size_t ssize_t s-float d-float bool flag-bit - padding static-string); + padding static-string static-wstring); my %primitive_aliases = ( 'ulong' => 'unsigned long', 's-float' => 'float', 'd-float' => 'double', 'static-string' => 'char', + 'static-wstring' => 'wchar_t', 'flag-bit' => 'void', 'padding' => 'void', ); diff --git a/SYNTAX.rst b/SYNTAX.rst index e415dbf1d..f9b0c676e 100644 --- a/SYNTAX.rst +++ b/SYNTAX.rst @@ -234,6 +234,7 @@ Primitive fields can be classified as following: 4) String:: + diff --git a/StructFields.pm b/StructFields.pm index 401da8259..519e77be9 100644 --- a/StructFields.pm +++ b/StructFields.pm @@ -294,6 +294,10 @@ sub get_struct_field_type($;%) { my $count = $tag->getAttribute('size') || 0; $prefix = "char"; $suffix = "[$count]"; + } elsif ($subtype eq 'static-wstring') { + my $count = $tag->getAttribute('size') || 0; + $prefix = "wchar_t"; + $suffix = "[$count]"; } elsif ($subtype eq 'padding') { my $count = $tag->getAttribute('size') || 0; my $alignment = $tag->getAttribute('alignment') || 1; @@ -572,6 +576,9 @@ sub render_field_metadata_rec($$) { if ($subtype eq 'static-string') { my $count = $field->getAttribute('size') || 0; push @field_defs, [ "${FLD}(STATIC_STRING, $name)", 'NULL', $count, $extra ]; + } elsif ($subtype eq 'static-wstring') { + my $count = $field->getAttribute('size') || 0; + push @field_defs, [ "${FLD}(PRIMITIVE, $name)", 'NULL', $count, $extra ]; } } elsif ($meta eq 'global' || $meta eq 'compound') { if (is_attr_true($field, 'ld:enum-size-forced')) { diff --git a/changelog.txt b/changelog.txt index e3662129e..5bcc756a5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -19,6 +19,7 @@ Template for new versions: # Future ## Structures +- added codegen support for ``static-wstring`` (``wchar_t *``), required to support DF 53.11 # 53.10-r2 diff --git a/data-definition.xsd b/data-definition.xsd index a40aaaa8f..ff3cb4d17 100644 --- a/data-definition.xsd +++ b/data-definition.xsd @@ -239,6 +239,7 @@ + @@ -555,6 +556,14 @@ + + + + + + + + diff --git a/lower-1.xslt b/lower-1.xslt index 101a8b03a..acec60225 100644 --- a/lower-1.xslt +++ b/lower-1.xslt @@ -207,12 +207,17 @@ Error: field corresponds to an enum value of + + + + +