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

Unified Diff: tools/json_schema_compiler/features_h_generator.py

Issue 437883002: Make the root_namespace argument to json_schema_compiler.gypi a string (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: un-escape %% for windows Created 6 years, 4 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: tools/json_schema_compiler/features_h_generator.py
diff --git a/tools/json_schema_compiler/features_h_generator.py b/tools/json_schema_compiler/features_h_generator.py
index 025f734fd9542d0623e8b938ee26e4391587f38c..4198bb4b1d92e8c35893536f2d4315273b2f8d9e 100644
--- a/tools/json_schema_compiler/features_h_generator.py
+++ b/tools/json_schema_compiler/features_h_generator.py
@@ -32,8 +32,12 @@ class _Generator(object):
.Append(cpp_util.GENERATED_FEATURE_MESSAGE % self._source_file)
.Append()
)
- ifndef_name = cpp_util.GenerateIfndefName(self._source_file_filename,
- self._class_name)
+
+ # Hack: for the purpose of gyp the header file will always be the source
+ # file with its file extension replaced by '.h'. Assume so.
+ output_file = os.path.splitext(self._namespace.source_file)[0] + '.h'
+ ifndef_name = cpp_util.GenerateIfndefName(output_file)
+
(c.Append('#ifndef %s' % ifndef_name)
.Append('#define %s' % ifndef_name)
.Append()

Powered by Google App Engine
This is Rietveld 408576698