Index: tools/json_schema_compiler/h_generator.py |
diff --git a/tools/json_schema_compiler/h_generator.py b/tools/json_schema_compiler/h_generator.py |
index 3c97bc62ef68688162ec1756a4b0bed3a6969471..dfc99cbea489a9f0d4f26938a8231fe60685f783 100644 |
--- a/tools/json_schema_compiler/h_generator.py |
+++ b/tools/json_schema_compiler/h_generator.py |
@@ -27,7 +27,8 @@ class HGenerator(object): |
.Append() |
) |
- ifndef_name = self._GenerateIfndefName() |
+ ifndef_name = cpp_util.GenerateIfndefName(self._namespace.source_file_dir, |
+ self._target_namespace) |
(c.Append('#ifndef %s' % ifndef_name) |
.Append('#define %s' % ifndef_name) |
.Append('#pragma once') |
@@ -263,13 +264,3 @@ class HGenerator(object): |
c.Eblock('};') |
return c |
- |
- def _GenerateIfndefName(self): |
- """Formats a path and filename as a #define name. |
- |
- e.g chrome/extensions/gen, file.h becomes CHROME_EXTENSIONS_GEN_FILE_H__. |
- """ |
- return (('%s_%s_H__' % |
- (self._namespace.source_file_dir, self._target_namespace)) |
- .upper().replace(os.sep, '_')) |
- |