mirror of
https://github.com/golang/go
synced 2024-11-22 06:44:40 -07:00
godefs: fix handling of negative constants
R=r CC=golang-dev https://golang.org/cl/849041
This commit is contained in:
parent
00f9f0c056
commit
5b257732ac
@ -294,8 +294,14 @@ Continue:
|
|||||||
Bprint(bout, "// Constants\n");
|
Bprint(bout, "// Constants\n");
|
||||||
if(ncon > 0) {
|
if(ncon > 0) {
|
||||||
Bprint(bout, lang->constbegin);
|
Bprint(bout, lang->constbegin);
|
||||||
for(i=0; i<ncon; i++)
|
for(i=0; i<ncon; i++) {
|
||||||
|
// Go can handle negative constants,
|
||||||
|
// but C enums may not be able to.
|
||||||
|
if(lang == &go)
|
||||||
|
Bprint(bout, lang->constfmt, con[i].name, con[i].value);
|
||||||
|
else
|
||||||
Bprint(bout, lang->constfmt, con[i].name, con[i].value & 0xFFFFFFFF);
|
Bprint(bout, lang->constfmt, con[i].name, con[i].value & 0xFFFFFFFF);
|
||||||
|
}
|
||||||
Bprint(bout, lang->constend);
|
Bprint(bout, lang->constend);
|
||||||
}
|
}
|
||||||
Bprint(bout, "\n");
|
Bprint(bout, "\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user