clint: Allow including .c.h files multiple times

Except when they are system just in case. There should be no .c.h system files 
though, but if there will be it is unlikely that they inherit the same 
convention.
This commit is contained in:
ZyX
2016-12-25 21:18:04 +03:00
parent 27343bc5b2
commit 38ab553eb2

View File

@@ -3001,9 +3001,10 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
include = match.group(2)
is_system = (match.group(1) == '<')
if include in include_state:
error(filename, linenum, 'build/include', 4,
'"%s" already included at %s:%s' %
(include, filename, include_state[include]))
if is_system or not include.endswith('.c.h'):
error(filename, linenum, 'build/include', 4,
'"%s" already included at %s:%s' %
(include, filename, include_state[include]))
else:
include_state[include] = linenum