Merge "Support replacing nested kernel structs" am: df901df77a
am: 0fc9a6cd64
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1750166 Change-Id: If1e12db6b06470f81545bb1b9e2da06fcf0d20c6
This commit is contained in:
commit
c9ff3412b4
1 changed files with 7 additions and 2 deletions
|
@ -1417,9 +1417,14 @@ class BlockList(object):
|
||||||
if struct_name in kernel_struct_replacements:
|
if struct_name in kernel_struct_replacements:
|
||||||
extra_includes.append("<bits/%s.h>" % struct_name)
|
extra_includes.append("<bits/%s.h>" % struct_name)
|
||||||
end = i + 2
|
end = i + 2
|
||||||
while end < len(b.tokens) and b.tokens[end].id != '}':
|
depth = 1
|
||||||
|
while end < len(b.tokens) and depth > 0:
|
||||||
|
if b.tokens[end].id == '}':
|
||||||
|
depth -= 1
|
||||||
|
elif b.tokens[end].id == '{':
|
||||||
|
depth += 1
|
||||||
end += 1
|
end += 1
|
||||||
end += 1 # Swallow '}'
|
end += 1 # Swallow last '}'
|
||||||
while end < len(b.tokens) and b.tokens[end].id != ';':
|
while end < len(b.tokens) and b.tokens[end].id != ';':
|
||||||
end += 1
|
end += 1
|
||||||
end += 1 # Swallow ';'
|
end += 1 # Swallow ';'
|
||||||
|
|
Loading…
Reference in a new issue