Skip #if lines in getNameFromDecl.

Otherwise we get all these 'defined' symbols everywhere.

Change-Id: I4c21a4df8963146a79af3511a400f06698f1078a
Reviewed-on: https://boringssl-review.googlesource.com/4292
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2015-04-09 00:06:03 -04:00 committed by Adam Langley
parent 0d8a758938
commit 71485af5e8

View File

@ -200,7 +200,18 @@ func skipPast(s, skip string) string {
return s return s
} }
func skipLine(s string) string {
i := strings.Index(s, "\n")
if i > 0 {
return s[i:]
}
return ""
}
func getNameFromDecl(decl string) (string, bool) { func getNameFromDecl(decl string) (string, bool) {
for strings.HasPrefix(decl, "#if") {
decl = skipLine(decl)
}
if strings.HasPrefix(decl, "struct ") { if strings.HasPrefix(decl, "struct ") {
return "", false return "", false
} }