Index: gpu/command_buffer/build_gles2_cmd_buffer.py |
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py |
index 226cb738a55d58fd482cacf7d2a65e2c14e73661..722ee08b5ef43ea5d988d6891c25e9f51819c521 100755 |
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py |
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py |
@@ -8298,6 +8298,7 @@ extern const NameToFunc g_gles2_function_table[] = { |
def WriteCommonUtilsImpl(self, filename): |
"""Writes the gles2 common utility header.""" |
enum_re = re.compile(r'\#define\s+(GL_[a-zA-Z0-9_]+)\s+([0-9A-Fa-fx]+)') |
+ chromium_re = re.compile(r'[a-zA-Z0-9_]+_CHROMIUM$') |
dict = {} |
for fname in ['third_party/khronos/GLES2/gl2.h', |
'third_party/khronos/GLES2/gl2ext.h', |
@@ -8309,8 +8310,14 @@ extern const NameToFunc g_gles2_function_table[] = { |
if m: |
name = m.group(1) |
value = m.group(2) |
- if len(value) <= 10 and not value in dict: |
- dict[value] = name |
+ if len(value) <= 10: |
+ if not value in dict: |
+ dict[value] = name |
+ # check our own _CHROMIUM macro conflicts with khronos GL headers. |
+ elif dict[value] != name and (chromium_re.match(name) |
no sievers
2014/11/18 19:57:20
I think and takes precedence and you need to group
|
+ or chromium_re.match(dict[value])): |
+ self.Error("code conflict %s and %s have the same code %s" % |
+ (dict[value], name, value)) |
file = CHeaderWriter(filename) |
file.Write("static const GLES2Util::EnumToString " |