Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl

Issue 923033003: Implement unions as members of structs. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl
index d9a398a193c2d4d4f8518444663c97e9ddd02ec0..b4b4df825bcd6385b1f16d74edf82dc3b4397fbd 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl
@@ -50,15 +50,17 @@ class {{union.name}}_Data;
#pragma pack(push, 1)
+{#--- Unions must be declared first because they can be members of structs #}
+{#--- Union class declarations #}
+{% for union in unions %}
+{% include "union_declaration.tmpl" %}
+{%- endfor %}
+
{#--- Class declarations #}
{% for struct in structs %}
{% include "struct_declaration.tmpl" %}
{%- endfor %}
-{% for union in unions %}
-{% include "union_declaration.tmpl" %}
-{%- endfor %}
-
#pragma pack(pop)
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698