Allow #pragma directives to be provided in the config file.
This commit is contained in:
parent
009a974a1a
commit
6135381cc7
2
main.go
2
main.go
|
@ -19,6 +19,7 @@ type conf struct {
|
|||
Classes []string
|
||||
Imports []string
|
||||
SysImports []string
|
||||
Pragma []string
|
||||
}
|
||||
|
||||
var Config conf
|
||||
|
@ -166,6 +167,7 @@ func Start() (err error) {
|
|||
w := wrap.NewWrapper(Debug)
|
||||
w.Import(Config.Imports)
|
||||
w.SysImport(Config.SysImports)
|
||||
w.Pragma(Config.Pragma)
|
||||
for _, n := range(unit.Children()) {
|
||||
switch x := n.(type) {
|
||||
case *ast.ObjCInterfaceDecl:
|
||||
|
|
10
wrap/main.go
10
wrap/main.go
|
@ -46,9 +46,13 @@ func (w *Wrapper) Import(ss []string) {
|
|||
|
||||
func (w *Wrapper) SysImport(ss []string) {
|
||||
for _,s := range ss {
|
||||
w.cCode.WriteString(`
|
||||
#import <` + s + `>
|
||||
`)
|
||||
w.cCode.WriteString("\n#import <" + s + ">\n")
|
||||
}
|
||||
}
|
||||
|
||||
func (w *Wrapper) Pragma(ss []string) {
|
||||
for _,s := range ss {
|
||||
w.cCode.WriteString("\n#pragma " + s + "\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user