export c header file for build library
This commit is contained in:
@@ -435,6 +435,7 @@ func (p Program) NewPackage(name, pkgPath string) Package {
|
||||
pyobjs: pyobjs, pymods: pymods, strs: strs,
|
||||
chkabi: chkabi, Prog: p,
|
||||
di: nil, cu: nil, glbDbgVars: glbDbgVars,
|
||||
export: make(map[string]string),
|
||||
}
|
||||
ret.abi.Init(pkgPath)
|
||||
return ret
|
||||
@@ -693,6 +694,8 @@ type aPackage struct {
|
||||
|
||||
NeedRuntime bool
|
||||
NeedPyInit bool
|
||||
|
||||
export map[string]string // pkgPath.nameInPkg => exportname
|
||||
}
|
||||
|
||||
type Package = *aPackage
|
||||
@@ -701,6 +704,14 @@ func (p Package) Module() llvm.Module {
|
||||
return p.mod
|
||||
}
|
||||
|
||||
func (p Package) SetExport(name, export string) {
|
||||
p.export[name] = export
|
||||
}
|
||||
|
||||
func (p Package) ExportFuncs() map[string]string {
|
||||
return p.export
|
||||
}
|
||||
|
||||
func (p Package) rtFunc(fnName string) Expr {
|
||||
p.NeedRuntime = true
|
||||
fn := p.Prog.runtime().Scope().Lookup(fnName).(*types.Func)
|
||||
|
||||
Reference in New Issue
Block a user