From: Russ Cox Date: Thu, 28 Aug 2014 03:41:27 +0000 (-0400) Subject: cmd/cc: translate C Eface type as Go interface{} X-Git-Tag: go1.4beta1~665 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=948bb9150e962ee77475d2abc6585ecc7ac7f755;p=gostls13.git cmd/cc: translate C Eface type as Go interface{} This will allow structs containing Efaces in C to be manipulated as structs containing real interfaces in Go. The eface struct is still defined for use by Go code. LGTM=iant R=golang-codereviews, iant CC=dvyukov, golang-codereviews, khr, r https://golang.org/cl/133980044 --- diff --git a/src/cmd/cc/godefs.c b/src/cmd/cc/godefs.c index edb8a5e287..20915ca8ca 100644 --- a/src/cmd/cc/godefs.c +++ b/src/cmd/cc/godefs.c @@ -218,11 +218,13 @@ printtypename(Type *t) n = s->name; else if(t->tag) n = t->tag->name; - if(strcmp(n, "String") == 0){ + if(strcmp(n, "String") == 0) Bprint(&outbuf, "string"); - } else if(strcmp(n, "Slice") == 0){ + else if(strcmp(n, "Slice") == 0) Bprint(&outbuf, "[]byte"); - } else + else if(strcmp(n, "Eface") == 0) + Bprint(&outbuf, "interface{}"); + else Bprint(&outbuf, "%U", n); break; case TFUNC: