mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-20 04:19:04 +00:00
cgo: define idents referenced only from macros
This commit is contained in:
committed by
Ron Evans
parent
8068419854
commit
c4867c8743
+2
-2
@@ -1148,7 +1148,7 @@ func (f *cgoFile) getASTDeclName(name string, found clangCursor, iscall bool) st
|
||||
if alias := cgoAliases["C."+name]; alias != "" {
|
||||
return alias
|
||||
}
|
||||
node := f.getASTDeclNode(name, found, iscall)
|
||||
node := f.getASTDeclNode(name, found)
|
||||
if node, ok := node.(*ast.FuncDecl); ok {
|
||||
if !iscall {
|
||||
return node.Name.Name + "$funcaddr"
|
||||
@@ -1160,7 +1160,7 @@ func (f *cgoFile) getASTDeclName(name string, found clangCursor, iscall bool) st
|
||||
|
||||
// getASTDeclNode will declare the given C AST node (if not already defined) and
|
||||
// returns it.
|
||||
func (f *cgoFile) getASTDeclNode(name string, found clangCursor, iscall bool) ast.Node {
|
||||
func (f *cgoFile) getASTDeclNode(name string, found clangCursor) ast.Node {
|
||||
if node, ok := f.defined[name]; ok {
|
||||
// Declaration was found in the current file, so return it immediately.
|
||||
return node
|
||||
|
||||
Reference in New Issue
Block a user