summaryrefslogtreecommitdiff
path: root/src/cmd/cgo/main.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-20 15:44:41 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-20 15:44:41 +0200
commit50104cc32a498f7517a51c8dc93106c51c7a54b4 (patch)
tree47af80be259cc7c45d0eaec7d42e61fa38c8e4fb /src/cmd/cgo/main.go
parentc072558b90f1bbedc2022b0f30c8b1ac4712538e (diff)
downloadgolang-50104cc32a498f7517a51c8dc93106c51c7a54b4.tar.gz
Imported Upstream version 2011.03.07.1upstream/2011.03.07.1
Diffstat (limited to 'src/cmd/cgo/main.go')
-rw-r--r--src/cmd/cgo/main.go12
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)