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
|
Classes []string
|
||||||
Imports []string
|
Imports []string
|
||||||
SysImports []string
|
SysImports []string
|
||||||
|
Pragma []string
|
||||||
}
|
}
|
||||||
|
|
||||||
var Config conf
|
var Config conf
|
||||||
|
@ -166,6 +167,7 @@ func Start() (err error) {
|
||||||
w := wrap.NewWrapper(Debug)
|
w := wrap.NewWrapper(Debug)
|
||||||
w.Import(Config.Imports)
|
w.Import(Config.Imports)
|
||||||
w.SysImport(Config.SysImports)
|
w.SysImport(Config.SysImports)
|
||||||
|
w.Pragma(Config.Pragma)
|
||||||
for _, n := range(unit.Children()) {
|
for _, n := range(unit.Children()) {
|
||||||
switch x := n.(type) {
|
switch x := n.(type) {
|
||||||
case *ast.ObjCInterfaceDecl:
|
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) {
|
func (w *Wrapper) SysImport(ss []string) {
|
||||||
for _,s := range ss {
|
for _,s := range ss {
|
||||||
w.cCode.WriteString(`
|
w.cCode.WriteString("\n#import <" + s + ">\n")
|
||||||
#import <` + s + `>
|
}
|
||||||
`)
|
}
|
||||||
|
|
||||||
|
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