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

cgo: better error for no C symbols

R=rsc, iant
CC=golang-dev, graeme.perrow
https://golang.org/cl/1193046
This commit is contained in:
Devon H. O'Dell 2010-05-21 17:31:18 -07:00 committed by Russ Cox
parent 13d5a19a98
commit b94f341bac

View File

@ -83,6 +83,11 @@ func main() {
// Reset p.Preamble so that we don't end up with conflicting headers / defines
p.Preamble = builtinProlog
openProg(input, p)
if len(p.Vardef) == 0 && len(p.Funcdef) == 0 && len(p.Enumdef) == 0 && len(p.Constdef) == 0 {
fatal("no C symbols were used in cgo file " + input)
}
for _, cref := range p.Crefs {
// Convert C.ulong to C.unsigned long, etc.
if expand, ok := expandName[cref.Name]; ok {