Commit afa66b7b authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

move_blink_source.py: '-' in path names should be replaced with '_' in include guards

Header files in platform/image-decoders/ and platform/image-encoders/
produced guard symbols like ..._PLATFORM_IMAGE-DECODERS_...

Bug: 578345
Change-Id: I266f58dccf511b14dcbff79dc184e49c7311da2d
Reviewed-on: https://chromium-review.googlesource.com/949808Reviewed-by: default avatarQuinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541261}
parent c618d824
...@@ -551,10 +551,10 @@ Bug: 768828 ...@@ -551,10 +551,10 @@ Bug: 768828
partial(self._replace_basename_only_include, subdir, source_path), content) partial(self._replace_basename_only_include, subdir, source_path), content)
def _update_include_guard(self, content, source_path): def _update_include_guard(self, content, source_path):
current_guard = re.sub(r'[.]', '_', self._fs.basename(source_path)) current_guard = re.sub(r'[-.]', '_', self._fs.basename(source_path))
new_path = relative_dest(self._fs, self._fs.relpath( new_path = relative_dest(self._fs, self._fs.relpath(
source_path, start=self._fs.join(self._repo_root, 'third_party', 'WebKit'))) source_path, start=self._fs.join(self._repo_root, 'third_party', 'WebKit')))
new_guard = 'THIRD_PARTY_BLINK_' + re.sub(r'[\\/.]', '_', new_path.upper()) + '_' new_guard = 'THIRD_PARTY_BLINK_' + re.sub(r'[-\\/.]', '_', new_path.upper()) + '_'
content = re.sub(r'#ifndef\s+(WTF_)?' + current_guard, '#ifndef ' + new_guard, content); content = re.sub(r'#ifndef\s+(WTF_)?' + current_guard, '#ifndef ' + new_guard, content);
content = re.sub(r'#define\s+(WTF_)?' + current_guard, '#define ' + new_guard, content); content = re.sub(r'#define\s+(WTF_)?' + current_guard, '#define ' + new_guard, content);
content = re.sub(r'#endif\s+//\s+(WTF_)?' + current_guard, '#endif // ' + new_guard, content); content = re.sub(r'#endif\s+//\s+(WTF_)?' + current_guard, '#endif // ' + new_guard, content);
......
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