diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-17 23:39:23 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-17 23:39:23 +0000 |
commit | 28f6ebf1fce1051dc33df5b0180103128b2e8218 (patch) | |
tree | 25d8490f8db5d5cd491c8efede0209d395ff078c /libgo | |
parent | 4d063b924ec758da6024643d5fcf94e3a98c7ab2 (diff) | |
download | gcc-28f6ebf1fce1051dc33df5b0180103128b2e8218.tar.gz |
gofrontend: deduplicate C syscall function declarations
A gccgo language extension allows a function to be declared multiple
times. Avoid the use of this extension by dedeplicating declarations
in mksyscall.awk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209508 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/syscall/mksyscall.awk | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libgo/go/syscall/mksyscall.awk b/libgo/go/syscall/mksyscall.awk index daf6554a6cd..8d009222a18 100644 --- a/libgo/go/syscall/mksyscall.awk +++ b/libgo/go/syscall/mksyscall.awk @@ -96,8 +96,11 @@ BEGIN { cfnresult = line printf("// Automatically generated wrapper for %s/%s\n", gofnname, cfnname) - printf("//extern %s\n", cfnname) - printf("func c_%s(%s) %s\n", cfnname, cfnparams, cfnresult) + if (!(cfnname in cfns)) { + cfns[cfnname] = 1 + printf("//extern %s\n", cfnname) + printf("func c_%s(%s) %s\n", cfnname, cfnparams, cfnresult) + } printf("func %s(%s) %s%s%s%s{\n", gofnname, gofnparams, gofnresults == "" ? "" : "(", gofnresults, gofnresults == "" ? "" : ")", gofnresults == "" ? "" : " ") |