aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 daf6554..8d00922 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 == "" ? "" : " ")