cgo: add package directory to header include paths

This commit is contained in:
Ayke van Laethem
2018-11-30 13:01:20 +01:00
parent c6069476a7
commit 6cacafb8dc
8 changed files with 25 additions and 8 deletions
+2 -2
View File
@@ -73,7 +73,7 @@ typedef unsigned long long _Cgo_ulonglong;
// processCgo extracts the `import "C"` statement from the AST, parses the
// comment with libclang, and modifies the AST to use this information.
func (p *Package) processCgo(filename string, f *ast.File) error {
func (p *Package) processCgo(filename string, f *ast.File, cflags []string) error {
info := &fileInfo{
File: f,
filename: filename,
@@ -106,7 +106,7 @@ func (p *Package) processCgo(filename string, f *ast.File) error {
// source location.
info.importCPos = spec.Path.ValuePos
err = info.parseFragment(cgoComment + cgoTypes)
err = info.parseFragment(cgoComment+cgoTypes, cflags)
if err != nil {
return err
}