summaryrefslogtreecommitdiff
path: root/libgo/mkruntimeinc.sh
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-08-30 21:49:49 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-08-30 21:49:49 +0000
commit4a140826453da37a134d792e0224f4e37343e68a (patch)
tree04d27dc317f007c64a3954cd2744b89bc7ed0b47 /libgo/mkruntimeinc.sh
parentaff0632d4fa0d55b2c830e5dc975242dd246fc87 (diff)
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
Diffstat (limited to 'libgo/mkruntimeinc.sh')
-rwxr-xr-xlibgo/mkruntimeinc.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/libgo/mkruntimeinc.sh b/libgo/mkruntimeinc.sh
index d29da9b6846..24837389f4f 100755
--- a/libgo/mkruntimeinc.sh
+++ b/libgo/mkruntimeinc.sh
@@ -29,6 +29,12 @@ do
sed -e '/struct '${TYPE}' {/,/^}/s/^.*$//' runtime.inc.tmp2 > runtime.inc.tmp3;
mv runtime.inc.tmp3 runtime.inc.tmp2
done
-sed -e 's/sigset/sigset_go/' runtime.inc.tmp2 > ${OUT}
+sed -e 's/sigset/sigset_go/' runtime.inc.tmp2 > runtime.inc.tmp3
+mv runtime.inc.tmp3 runtime.inc.tmp2
+
+# Make all the fields of type structs const.
+sed -e '/struct .*type {/,/^}/ s/ \(.*;\)/ const \1/' < runtime.inc.tmp2 > runtime.inc.tmp3
+mv -f runtime.inc.tmp3 ${OUT}
+
rm -f runtime.inc.tmp2 runtime.inc.tmp3
exit 0