diff --git a/StructFields.pm b/StructFields.pm index 519e77be9..720cd5c6f 100644 --- a/StructFields.pm +++ b/StructFields.pm @@ -340,8 +340,9 @@ sub get_struct_field_type($;%) { $prefix = get_container_item_type($tag, -weak => 1, -void => 'void')."*"; } elsif ($meta eq 'static-array') { ($prefix, $suffix) = get_container_item_type($tag); + header_ref("array"); my $count = get_container_count($tag); - $suffix = "[$count]".$suffix; + $prefix = "std::array<$prefix,$count>"; } elsif ($meta eq 'primitive') { local $_ = $tag; my $handler = $custom_primitive_handlers{$subtype} or die "Invalid primitive: $subtype\n"; diff --git a/changelog.txt b/changelog.txt index 0701dd3d9..533e7378e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -19,6 +19,7 @@ Template for new versions: # Future ## Structures +- changed codegen to use ``std::array`` for fixed-length arrays instead of C-style arrays # 53.15-r1 diff --git a/codegen.pl b/codegen.pl index bcada51c5..ad2edbe37 100755 --- a/codegen.pl +++ b/codegen.pl @@ -154,7 +154,7 @@ BEGIN emit "INIT_GLOBAL_FUNCTION_PREFIX"; for my $item (@items) { - emit "INIT_GLOBAL_FUNCTION_ITEM(", $item->[0], ', ', $item->[1], ");"; + emit "INIT_GLOBAL_FUNCTION_ITEM(", $item->[1], ', ', $item->[0], ");"; } } "void InitGlobals() "; } "namespace global ";