diff options
Diffstat (limited to 'src/cmd/cgo/main.go')
-rw-r--r-- | src/cmd/cgo/main.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go index b15d34527..2dc662de5 100644 --- a/src/cmd/cgo/main.go +++ b/src/cmd/cgo/main.go @@ -82,11 +82,17 @@ type ExpFunc struct { ExpName string // name to use from C } +// A TypeRepr contains the string representation of a type. +type TypeRepr struct { + Repr string + FormatArgs []interface{} +} + // A Type collects information about a type in both the C and Go worlds. type Type struct { Size int64 Align int64 - C string + C *TypeRepr Go ast.Expr EnumValues map[string]int64 } @@ -215,6 +221,10 @@ func main() { fs[i] = f } + // make sure that _obj directory exists, so that we can write + // all the output files there. + os.Mkdir("_obj", 0777) + for i, input := range goFiles { f := fs[i] p.Translate(f) |