diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-04-17 23:39:23 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-04-17 23:39:23 +0000 |
commit | 5584c49a11b2a2427b4ca0323b8ca213de095573 (patch) | |
tree | 25d8490f8db5d5cd491c8efede0209d395ff078c /libgo/go | |
parent | e8ad3ca026f1417bb2dfea7e7193227b28482e41 (diff) | |
download | gcc-5584c49a11b2a2427b4ca0323b8ca213de095573.zip gcc-5584c49a11b2a2427b4ca0323b8ca213de095573.tar.gz gcc-5584c49a11b2a2427b4ca0323b8ca213de095573.tar.bz2 |
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.
From-SVN: r209508
Diffstat (limited to 'libgo/go')
-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 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 == "" ? "" : " ") |