Commit 5584c49a by Ian Lance Taylor

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
parent e8ad3ca0
......@@ -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 == "" ? "" : " ")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment