This is to support cases such as WebKitGTK+, that have C API
implemented in C++ files. Do note this does not mean we support proper
C++ parsing.
https://bugzilla.gnome.org/show_bug.cgi?id=627152
filenames = []
for arg in args:
- if (arg.endswith('.c') or
- arg.endswith('.h')):
+ # We don't support real C++ parsing yet, but we should be able
+ # to understand C API implemented in C++ files.
+ if (arg.endswith('.c') or arg.endswith('.cpp') or
+ arg.endswith('.cc') or arg.endswith('.cxx') or
+ arg.endswith('.h') or arg.endswith('.hpp') or
+ arg.endswith('.hxx')):
if not os.path.exists(arg):
_error('%s: no such a file or directory' % (arg, ))
# Make absolute, because we do comparisons inside scannerparser.c
headers = []
for filename in filenames:
- if filename.endswith('.c'):
+ if (filename.endswith('.c') or filename.endswith('.cpp') or
+ filename.endswith('.cc') or filename.endswith('.cxx')):
filename = os.path.abspath(filename)
self._scanner.lex_filename(filename)
else: