| Index: mojo/public/tools/bindings/generators/mojom_cpp_generator.py
|
| diff --git a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
|
| index c75013badf88a19cab5a678a1b77174e20c877fc..82888e95f088d74d21239128c40efe951dce3c74 100644
|
| --- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
|
| +++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
|
| @@ -39,6 +39,7 @@ _for_blink = False
|
| # TODO(rockot, yzshen): The variant handling is kind of a hack currently. Make
|
| # it right.
|
| _variant = None
|
| +_export_attribute = None
|
|
|
|
|
| class _NameFormatter(object):
|
| @@ -220,7 +221,8 @@ def FormatConstantDeclaration(constant, nested=False):
|
| if mojom.IsStringKind(constant.kind):
|
| if nested:
|
| return "const char %s[]" % constant.name
|
| - return "extern const char %s[]" % constant.name
|
| + return "%sextern const char %s[]" % \
|
| + ((_export_attribute + " ") if _export_attribute else "", constant.name)
|
| return "constexpr %s %s = %s" % (GetCppPodType(constant.kind), constant.name,
|
| ConstantValue(constant))
|
|
|
| @@ -730,6 +732,8 @@ class Generator(generator.Generator):
|
| _use_once_callback = self.use_once_callback
|
| global _variant
|
| _variant = self.variant
|
| + global _export_attribute
|
| + _export_attribute = self.export_attribute
|
| suffix = "-%s" % self.variant if self.variant else ""
|
| self.Write(self.GenerateModuleHeader(),
|
| self.MatchMojomFilePath("%s%s.h" % (self.module.name, suffix)))
|
|
|