Skip to content

Commit 12c65ef

Browse files
committed
fix (extern "C") prototype generation
fixes #126 Signed-off-by: Martino Facchin <[email protected]>
1 parent ab082ad commit 12c65ef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/arduino.cc/builder/ctags/ctags_parser.go

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const KIND_FUNCTION = "function"
4747

4848
const TEMPLATE = "template"
4949
const STATIC = "static"
50+
const EXTERN = "extern \"C\""
5051

5152
var KNOWN_TAG_KINDS = map[string]bool{
5253
"prototype": true,
@@ -101,6 +102,9 @@ func addPrototype(tag *types.CTag) {
101102
if strings.Index(tag.Code, STATIC+" ") != -1 {
102103
tag.PrototypeModifiers = tag.PrototypeModifiers + " " + STATIC
103104
}
105+
if strings.Index(tag.Code, EXTERN+" ") != -1 {
106+
tag.PrototypeModifiers = tag.PrototypeModifiers + " " + EXTERN
107+
}
104108
tag.PrototypeModifiers = strings.TrimSpace(tag.PrototypeModifiers)
105109
}
106110

0 commit comments

Comments
 (0)