mirror of
https://github.com/golang/go
synced 2024-11-19 06:04:39 -07:00
dist: fix Plan 9 build
Since CL 115060044, mkanames declares an empty array in anames8.c and anames6.c, which is not valid for the Plan 9 compiler. char* cnames8[] = { }; This change makes mkanames not declaring the cnames array when no C_ constants are found. LGTM=iant R=minux, iant CC=golang-codereviews https://golang.org/cl/117680043
This commit is contained in:
parent
bf13b711bd
commit
de1ab89f03
7
src/cmd/dist/buildgc.c
vendored
7
src/cmd/dist/buildgc.c
vendored
@ -69,7 +69,7 @@ gcopnames(char *dir, char *file)
|
|||||||
void
|
void
|
||||||
mkanames(char *dir, char *file)
|
mkanames(char *dir, char *file)
|
||||||
{
|
{
|
||||||
int i, ch;
|
int i, j, ch;
|
||||||
Buf in, b, out, out2;
|
Buf in, b, out, out2;
|
||||||
Vec lines;
|
Vec lines;
|
||||||
char *p;
|
char *p;
|
||||||
@ -108,6 +108,7 @@ mkanames(char *dir, char *file)
|
|||||||
}
|
}
|
||||||
bwritestr(&out, "};\n");
|
bwritestr(&out, "};\n");
|
||||||
|
|
||||||
|
j=0;
|
||||||
bprintf(&out2, "char* cnames%c[] = {\n", ch);
|
bprintf(&out2, "char* cnames%c[] = {\n", ch);
|
||||||
for(i=0; i<lines.len; i++) {
|
for(i=0; i<lines.len; i++) {
|
||||||
if(hasprefix(lines.p[i], "\tC_")) {
|
if(hasprefix(lines.p[i], "\tC_")) {
|
||||||
@ -119,10 +120,12 @@ mkanames(char *dir, char *file)
|
|||||||
*p = '\0';
|
*p = '\0';
|
||||||
p = lines.p[i] + 3;
|
p = lines.p[i] + 3;
|
||||||
bwritestr(&out2, bprintf(&b, "\t\"%s\",\n", p));
|
bwritestr(&out2, bprintf(&b, "\t\"%s\",\n", p));
|
||||||
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bwritestr(&out2, "};\n");
|
bwritestr(&out2, "};\n");
|
||||||
bwriteb(&out, &out2);
|
if(j>0)
|
||||||
|
bwriteb(&out, &out2);
|
||||||
|
|
||||||
writefile(&out, file, 0);
|
writefile(&out, file, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user