Commit 3ca8d3e1 authored by Amos Lim's avatar Amos Lim Committed by Commit Bot

Let generated xpath_grammar header follow chromium style on header guards

Generated header files need to follow chromium style on header guards.
This CL has no behavior changes.

Bug: 896720
Change-Id: I5ed457086e369fd515f5969daebfc8e1ef623112
Reviewed-on: https://chromium-review.googlesource.com/c/1293059Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Amos Lim <eui-sang.lim@samsung.com>
Cr-Commit-Position: refs/heads/master@{#601502}
parent 07959d96
......@@ -42,6 +42,8 @@ import os.path
import subprocess
import sys
from blinkbuild.name_style_converter import NameStyleConverter
assert len(sys.argv) == 4 or len(sys.argv) == 5
inputFile = sys.argv[1]
......@@ -105,9 +107,12 @@ os.unlink(outputHTmp)
# Rewrite the generated header with #include guards.
outputH = os.path.join(outputDir, inputRoot + '.h')
outputHInGen = outputH.replace('gen/', '')
headerGuard = NameStyleConverter(outputHInGen).to_header_guard()
outputHFile = open(outputH, 'w')
print >>outputHFile, '#ifndef %sH' % inputRoot
print >>outputHFile, '#define %sH' % inputRoot
print >>outputHFile, '#ifndef %s' % headerGuard
print >>outputHFile, '#define %s' % headerGuard
print >>outputHFile, outputHContents
print >>outputHFile, '#endif'
print >>outputHFile, '#endif // %s' % headerGuard
outputHFile.close()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment