From 4a140826453da37a134d792e0224f4e37343e68a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 30 Aug 2019 21:49:49 +0000 Subject: compile, runtime: permit anonymous and empty fields in C header Permit putting structs with anonymous and empty fields in the C header file runtime.inc that is used to build the C runtime code. This is required for upcoming 1.13 support, as the m struct has picked up an anonymous field. Doing this lets the C header contain all the type descriptor structs, so start using those in the C code. This cuts the number of copies of type descriptor definitions from 3 to 2. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192343 From-SVN: r275227 --- libgo/runtime/go-construct-map.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'libgo/runtime/go-construct-map.c') diff --git a/libgo/runtime/go-construct-map.c b/libgo/runtime/go-construct-map.c index 0e71ba9..a721058 100644 --- a/libgo/runtime/go-construct-map.c +++ b/libgo/runtime/go-construct-map.c @@ -9,20 +9,17 @@ #include #include "runtime.h" -#include "go-type.h" -extern void *makemap (const struct __go_map_type *, intgo hint, - void *) +extern void *makemap (const struct maptype *, intgo hint, void *) __asm__ (GOSYM_PREFIX "runtime.makemap"); -extern void *mapassign (const struct __go_map_type *, void *hmap, - const void *key) +extern void *mapassign (const struct maptype *, void *hmap, const void *key) __asm__ (GOSYM_PREFIX "runtime.mapassign"); void * -__go_construct_map (const struct __go_map_type *type, - uintptr_t count, uintptr_t entry_size, - uintptr_t val_offset, const void *ventries) +__go_construct_map (const struct maptype *type, uintptr_t count, + uintptr_t entry_size, uintptr_t val_offset, + const void *ventries) { void *ret; const unsigned char *entries; @@ -35,7 +32,7 @@ __go_construct_map (const struct __go_map_type *type, for (i = 0; i < count; ++i) { p = mapassign (type, ret, entries); - typedmemmove (type->__val_type, p, entries + val_offset); + typedmemmove (type->elem, p, entries + val_offset); entries += entry_size; } -- cgit v1.1