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

Side by Side Diff: mojo/public/tools/bindings/generators/cpp_templates/module-shared-internal.h.tmpl

Issue 2419163002: More fix on generating correct C++ symbol name for scoped native enums (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 {%- set header_guard = "%s_SHARED_INTERNAL_H_"|format( 5 {%- set header_guard = "%s_SHARED_INTERNAL_H_"|format(
6 module.path|upper|replace("/","_")|replace(".","_")| 6 module.path|upper|replace("/","_")|replace(".","_")|
7 replace("-", "_")) %} 7 replace("-", "_")) %}
8 8
9 #ifndef {{header_guard}} 9 #ifndef {{header_guard}}
10 #define {{header_guard}} 10 #define {{header_guard}}
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 {%- endfor %} 43 {%- endfor %}
44 44
45 {%- for union in unions %} 45 {%- for union in unions %}
46 class {{union.name}}_Data; 46 class {{union.name}}_Data;
47 {%- endfor %} 47 {%- endfor %}
48 48
49 {#--- Enums #} 49 {#--- Enums #}
50 {%- from "enum_macros.tmpl" import enum_data_decl -%} 50 {%- from "enum_macros.tmpl" import enum_data_decl -%}
51 {%- for enum in all_enums %} 51 {%- for enum in all_enums %}
52 {%- if enum|is_native_only_kind %} 52 {%- if enum|is_native_only_kind %}
53 using {{enum.name}}_Data = mojo::internal::NativeEnum_Data; 53 using {{enum|get_name_for_kind(flatten_nested_kind=True)}}_Data =
54 mojo::internal::NativeEnum_Data;
54 {%- else %} 55 {%- else %}
55 {{enum_data_decl(enum)}} 56 {{enum_data_decl(enum)}}
56 {%- endif %} 57 {%- endif %}
57 {%- endfor %} 58 {%- endfor %}
58 59
59 #pragma pack(push, 1) 60 #pragma pack(push, 1)
60 61
61 {#--- Unions must be declared first because they can be members of structs #} 62 {#--- Unions must be declared first because they can be members of structs #}
62 {#--- Union class declarations #} 63 {#--- Union class declarations #}
63 {%- for union in unions %} 64 {%- for union in unions %}
(...skipping 22 matching lines...) Expand all
86 {%- endfor %} 87 {%- endfor %}
87 88
88 #pragma pack(pop) 89 #pragma pack(pop)
89 90
90 } // namespace internal 91 } // namespace internal
91 {%- for namespace in namespaces_as_array|reverse %} 92 {%- for namespace in namespaces_as_array|reverse %}
92 } // namespace {{namespace}} 93 } // namespace {{namespace}}
93 {%- endfor %} 94 {%- endfor %}
94 95
95 #endif // {{header_guard}} 96 #endif // {{header_guard}}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698