Commit b94f341b authored by Devon H. O'Dell's avatar Devon H. O'Dell Committed by Russ Cox

cgo: better error for no C symbols

R=rsc, iant
CC=golang-dev, graeme.perrow
https://golang.org/cl/1193046
parent 13d5a19a
...@@ -83,6 +83,11 @@ func main() { ...@@ -83,6 +83,11 @@ func main() {
// Reset p.Preamble so that we don't end up with conflicting headers / defines // Reset p.Preamble so that we don't end up with conflicting headers / defines
p.Preamble = builtinProlog p.Preamble = builtinProlog
openProg(input, p) 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 { for _, cref := range p.Crefs {
// Convert C.ulong to C.unsigned long, etc. // Convert C.ulong to C.unsigned long, etc.
if expand, ok := expandName[cref.Name]; ok { if expand, ok := expandName[cref.Name]; ok {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment