1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:44:40 -07:00

cgo: -cdefs should translate unsafe.Pointer to void *

Fixes #2454.

R=rsc, mikioh.mikioh, golang-dev, iant, iant
CC=golang-dev
https://golang.org/cl/5557068
This commit is contained in:
Shenghou Ma 2012-01-23 14:45:30 -05:00 committed by Russ Cox
parent 370f4e49cd
commit eb984f524e

View File

@ -268,6 +268,11 @@ func cdecl(name, typ string) string {
typ = typ[i:]
}
// X T -> T X
// Handle the special case: 'unsafe.Pointer' is 'void *'
if typ == "unsafe.Pointer" {
typ = "void"
name = "*" + name
}
return typ + "\t" + name
}