Merge 683dfbf9462dc6ae6b74a02589965e700ce3c252 into 8487c083e1faecb1259be8a8873618cfdb69d33d

This commit is contained in:
zhangchen909 2024-02-27 16:46:46 -07:00 committed by GitHub
commit 4ec0f1caad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

4
cpplint/cpplint.py vendored
View File

@ -1916,11 +1916,11 @@ def CheckForHeaderGuard(filename, clean_lines, error):
linesplit = line.split()
if len(linesplit) >= 2:
# find the first occurrence of #ifndef and #define, save arg
if not ifndef and linesplit[0] == '#ifndef':
if not ifndef and (linesplit[0] == '#ifndef' or linesplit[0] == '\ufeff#ifndef'):
# set ifndef to the header guard presented on the #ifndef line.
ifndef = linesplit[1]
ifndef_linenum = linenum
if not define and linesplit[0] == '#define':
if not define and (linesplit[0] == '#define' or linesplit[0] == '\ufeff#define'):
define = linesplit[1]
# find the last occurrence of #endif, save entire line
if line.startswith('#endif'):