summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-17 23:39:23 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-17 23:39:23 +0000
commit28f6ebf1fce1051dc33df5b0180103128b2e8218 (patch)
tree25d8490f8db5d5cd491c8efede0209d395ff078c /libgo
parent4d063b924ec758da6024643d5fcf94e3a98c7ab2 (diff)
downloadgcc-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.awk7
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 == "" ? "" : " ")