Index: mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl |
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl |
index 9e835718d492e90197153fccef46241ac9af65ee..28f7f781313148ed29284c24b86109ddf023a6a1 100644 |
--- a/mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl |
+++ b/mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl |
@@ -32,7 +32,7 @@ class {{class_name}} { |
private: |
{{class_name}}() { |
_header_.num_bytes = sizeof(*this); |
- _header_.num_fields = 3; |
+ _header_.num_fields = {{struct.packed.packed_fields|length}}; |
} |
mojo::internal::StructHeader _header_; |