mirror of
https://github.com/golang/go
synced 2024-11-02 11:50:30 +00:00
cmd/cgo: use standard generated code comment
Change cgo to follow https://golang.org/s/generatedcode. For the C code we continue to use /* */ comments, so they don't follow the format exactly. It doesn't really matter since the format is only for Go code anyhow. This CL changes the C code to be similar for consistency. Fixes #25623 Change-Id: Idcfee53ec4069924d173ab8cedeb7bcfb7312863 Reviewed-on: https://go-review.googlesource.com/115035 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
parent
99695bd90b
commit
ab922e1012
2 changed files with 6 additions and 6 deletions
|
@ -19,7 +19,7 @@ import (
|
|||
func (p *Package) godefs(f *File, srcfile string) string {
|
||||
var buf bytes.Buffer
|
||||
|
||||
fmt.Fprintf(&buf, "// Created by cgo -godefs - DO NOT EDIT\n")
|
||||
fmt.Fprintf(&buf, "// Code generated by cmd/cgo -godefs; DO NOT EDIT.\n")
|
||||
fmt.Fprintf(&buf, "// %s %s\n", filepath.Base(os.Args[0]), strings.Join(os.Args[1:], " "))
|
||||
fmt.Fprintf(&buf, "\n")
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ func (p *Package) writeDefs() {
|
|||
// Write second Go output: definitions of _C_xxx.
|
||||
// In a separate file so that the import of "unsafe" does not
|
||||
// pollute the original file.
|
||||
fmt.Fprintf(fgo2, "// Created by cgo - DO NOT EDIT\n\n")
|
||||
fmt.Fprintf(fgo2, "// Code generated by cmd/cgo; DO NOT EDIT.\n\n")
|
||||
fmt.Fprintf(fgo2, "package %s\n\n", p.PackageName)
|
||||
fmt.Fprintf(fgo2, "import \"unsafe\"\n\n")
|
||||
if !*gccgo && *importRuntimeCgo {
|
||||
|
@ -536,7 +536,7 @@ func (p *Package) writeOutput(f *File, srcfile string) {
|
|||
p.GccFiles = append(p.GccFiles, base+".cgo2.c")
|
||||
|
||||
// Write Go output: Go input with rewrites of C.xxx to _C_xxx.
|
||||
fmt.Fprintf(fgo1, "// Created by cgo - DO NOT EDIT\n\n")
|
||||
fmt.Fprintf(fgo1, "// Code generated by cmd/cgo; DO NOT EDIT.\n\n")
|
||||
fmt.Fprintf(fgo1, "//line %s:1\n", srcfile)
|
||||
fgo1.Write(f.Edit.Bytes())
|
||||
|
||||
|
@ -740,7 +740,7 @@ func (p *Package) packedAttribute() string {
|
|||
func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
|
||||
p.writeExportHeader(fgcch)
|
||||
|
||||
fmt.Fprintf(fgcc, "/* Created by cgo - DO NOT EDIT. */\n")
|
||||
fmt.Fprintf(fgcc, "/* Code generated by cmd/cgo; DO NOT EDIT. */\n\n")
|
||||
fmt.Fprintf(fgcc, "#include <stdlib.h>\n")
|
||||
fmt.Fprintf(fgcc, "#include \"_cgo_export.h\"\n\n")
|
||||
|
||||
|
@ -981,7 +981,7 @@ func (p *Package) writeGccgoExports(fgo2, fm, fgcc, fgcch io.Writer) {
|
|||
|
||||
p.writeExportHeader(fgcch)
|
||||
|
||||
fmt.Fprintf(fgcc, "/* Created by cgo - DO NOT EDIT. */\n")
|
||||
fmt.Fprintf(fgcc, "/* Code generated by cmd/cgo; DO NOT EDIT. */\n\n")
|
||||
fmt.Fprintf(fgcc, "#include \"_cgo_export.h\"\n")
|
||||
|
||||
fmt.Fprintf(fgcc, "%s\n", gccgoExportFileProlog)
|
||||
|
@ -1147,7 +1147,7 @@ func (p *Package) writeGccgoExports(fgo2, fm, fgcc, fgcch io.Writer) {
|
|||
|
||||
// writeExportHeader writes out the start of the _cgo_export.h file.
|
||||
func (p *Package) writeExportHeader(fgcch io.Writer) {
|
||||
fmt.Fprintf(fgcch, "/* Created by \"go tool cgo\" - DO NOT EDIT. */\n\n")
|
||||
fmt.Fprintf(fgcch, "/* Code generated by cmd/cgo; DO NOT EDIT. */\n\n")
|
||||
pkg := *importPath
|
||||
if pkg == "" {
|
||||
pkg = p.PackagePath
|
||||
|
|
Loading…
Reference in a new issue