1
0
mirror of https://github.com/golang/go synced 2024-09-24 21:10:12 -06:00

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
This commit is contained in:
Dave Cheney 2014-03-01 11:13:29 +11:00
parent c535ce8506
commit 0c6e4b9660
2 changed files with 9 additions and 0 deletions

View File

@ -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*))

View File

@ -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