Fix static inline and restrict

This commit is contained in:
Ganesh Viswanathan 2020-07-02 12:41:56 -05:00
commit 1e88a3b42e
2 changed files with 3 additions and 2 deletions

View file

@ -1703,8 +1703,9 @@ proc addDef(gState: State, node: TSNode) =
let
start = getStartAtom(node)
commentNodes = gState.getCommentNodes(node)
fdecl = node[start+1].firstChildInTree("function_declarator")
if node[start+1].getName() == "function_declarator":
if not fdecl.isNil:
if not gState.noHeader:
gState.addProc(node[start+1], node[start], commentNodes)
else:

View file

@ -307,7 +307,7 @@ proc getPreprocessor*(gState: State, fullpath: string) =
# Remove gcc special calls
# https://github.com/tree-sitter/tree-sitter-c/issues/43
args.add @["-D__attribute__(x)=", "-D__restrict=", "-D__extension__=", "-D__inline__=inline",
args.add @["-D__attribute__(x)=", "-D__restrict=", "-D__restrict__=", "-D__extension__=", "-D__inline__=inline",
"-D__inline=inline", "-D_Noreturn=", &"{fullpath.sanitizePath}"]
# Include content only from file