public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgo patch committed: Avoid duplicate function declarations in syscall
@ 2014-04-18  3:06 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2014-04-18  3:06 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

This patch from Peter Collingbourne avoids duplicate function
declarations in the generated libcalls.go file when building the syscall
package.  Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 765 bytes --]

diff -r 5009262c3e56 libgo/go/syscall/mksyscall.awk
--- a/libgo/go/syscall/mksyscall.awk	Thu Apr 17 16:26:57 2014 -0700
+++ b/libgo/go/syscall/mksyscall.awk	Thu Apr 17 16:30:29 2014 -0700
@@ -96,8 +96,11 @@
     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 == "" ? "" : " ")

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-04-17 23:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-18  3:06 libgo patch committed: Avoid duplicate function declarations in syscall Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).