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

Unified Diff: third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl

Issue 1127293003: Update mojo sdk to rev f84766d3b6420b7cf6a113d9d65d73cb5fe18d90 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting Created 5 years, 7 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: third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl b/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
index 210ee2e5f096afcf0b38b546394d8c8cac910cbf..463d2607a2c3bd97d5578165afb08c5e0067f718 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
@@ -28,14 +28,17 @@
#include "mojo/public/cpp/bindings/lib/validation_util.h"
#include "mojo/public/cpp/environment/lib/scoped_task_tracking.h"
#include "mojo/public/cpp/environment/logging.h"
+#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
{%- for namespace in namespaces_as_array %}
namespace {{namespace}} {
{%- endfor %}
{#--- Constants #}
-{% for constant in module.constants %}
+{%- for constant in module.constants %}
+{%- if not constant.kind|is_integral_kind %}
const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|constant_value}};
+{%- endif %}
{%- endfor %}
namespace internal {
@@ -77,8 +80,12 @@ const uint32_t {{method_name}} = {{method.ordinal}};
{#--- Struct Constants #}
{%- for struct in structs %}
-{% for constant in struct.constants %}
-const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{constant|constant_value}};
+{%- for constant in struct.constants %}
+{%- if constant.kind|is_integral_kind %}
+MOJO_STATIC_CONST_MEMBER_DEFINITION const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}};
+{%- else %}
+MOJO_STATIC_CONST_MEMBER_DEFINITION const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{constant|constant_value}};
+{%- endif %}
{%- endfor %}
{%- endfor %}

Powered by Google App Engine
This is Rietveld 408576698