mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
race: cmd/cgo changes
This is a part of a bigger change that adds data race detection feature: https://golang.org/cl/6456044 This change breaks circular dependency between runtime/race and syscall packages. R=rsc CC=golang-dev https://golang.org/cl/6498079
This commit is contained in:
parent
0e60019a42
commit
99b6e9f73b
2 changed files with 7 additions and 2 deletions
|
|
@ -51,12 +51,16 @@ func (p *Package) writeDefs() {
|
|||
fmt.Fprintf(fgo2, "// Created by cgo - DO NOT EDIT\n\n")
|
||||
fmt.Fprintf(fgo2, "package %s\n\n", p.PackageName)
|
||||
fmt.Fprintf(fgo2, "import \"unsafe\"\n\n")
|
||||
fmt.Fprintf(fgo2, "import \"syscall\"\n\n")
|
||||
if *importSyscall {
|
||||
fmt.Fprintf(fgo2, "import \"syscall\"\n\n")
|
||||
}
|
||||
if !*gccgo && *importRuntimeCgo {
|
||||
fmt.Fprintf(fgo2, "import _ \"runtime/cgo\"\n\n")
|
||||
}
|
||||
fmt.Fprintf(fgo2, "type _ unsafe.Pointer\n\n")
|
||||
fmt.Fprintf(fgo2, "func _Cerrno(dst *error, x int) { *dst = syscall.Errno(x) }\n")
|
||||
if *importSyscall {
|
||||
fmt.Fprintf(fgo2, "func _Cerrno(dst *error, x int) { *dst = syscall.Errno(x) }\n")
|
||||
}
|
||||
|
||||
typedefNames := make([]string, 0, len(typedef))
|
||||
for name := range typedef {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue