From: Dave Cheney Date: Sat, 1 Mar 2014 00:13:29 +0000 (+1100) Subject: runtime: small Native Client fixes X-Git-Tag: go1.3beta1~524 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0c6e4b9660171034052f9f85c734ddb13023100e;p=gostls13.git runtime: small Native Client fixes cgocall.c: define the CBARGS macro for GOARCH_amd64p32. I don't think the value of this macro will ever be used under nacl/amd64p32 but it is required to compile even if cgo is not used. hashmap.goc: amd64p32 uses 32bit words. LGTM=iant R=rsc, iant CC=golang-codereviews https://golang.org/cl/69960044 --- diff --git a/src/pkg/runtime/cgocall.c b/src/pkg/runtime/cgocall.c index 639139d74a..9f8db3ae09 100644 --- a/src/pkg/runtime/cgocall.c +++ b/src/pkg/runtime/cgocall.c @@ -223,6 +223,12 @@ struct CallbackArgs #define CBARGS (CallbackArgs*)((byte*)m->g0->sched.sp+2*sizeof(void*)) #endif +// There is no cgo support for nacl/amd64p32 but we need to have something here +// so use the amd64 value as a placeholder. +#ifdef GOARCH_amd64p32 +#define CBARGS (CallbackArgs*)((byte*)m->g0->sched.sp+2*sizeof(void*)) +#endif + // On 386, stack frame is three words, plus caller PC. #ifdef GOARCH_386 #define CBARGS (CallbackArgs*)((byte*)m->g0->sched.sp+4*sizeof(void*)) diff --git a/src/pkg/runtime/hashmap.goc b/src/pkg/runtime/hashmap.goc index dbec9a689e..4900a16ff4 100644 --- a/src/pkg/runtime/hashmap.goc +++ b/src/pkg/runtime/hashmap.goc @@ -448,6 +448,9 @@ hash_lookup(MapType *t, Hmap *h, byte **keyp) #ifdef GOARCH_amd64 #define CHECKTYPE uint64 #endif +#ifdef GOARCH_amd64p32 +#define CHECKTYPE uint32 +#endif #ifdef GOARCH_386 #define CHECKTYPE uint32 #endif