* Increase portability by avoiding "-" in regexp sets.
* Sort vector before use.
This commit is contained in:
parent
69492ff4ea
commit
965342ff43
1 changed files with 5 additions and 7 deletions
|
@ -11,28 +11,26 @@ function sort(V, N, tmp, i, j) {
|
||||||
|
|
||||||
BEGIN { nname = 0; }
|
BEGIN { nname = 0; }
|
||||||
|
|
||||||
/ [A-Z] / {
|
/^[0123456789abcdef]+ [ABCDGINRSTUVW] / {
|
||||||
if ($3 != "symbols") {
|
if ($3 != "symbols" && $3 != "symbols_nelts") {
|
||||||
name[nname] = $3;
|
name[nname] = $3;
|
||||||
nname++;
|
nname++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
|
sort(name, nname);
|
||||||
|
|
||||||
print "#include \"loader/symbols-def.h\"\n";
|
print "#include \"loader/symbols-def.h\"\n";
|
||||||
|
|
||||||
# Must deal with compiler builtins etc.
|
# Must deal with compiler builtins etc.
|
||||||
for (x = 0; x < nname; x++) {
|
for (x = 0; x < nname; x++) {
|
||||||
if (name[x] == "printf")
|
if (name[x] == "printf")
|
||||||
print "extern int printf(const char *, ...);";
|
print "extern int printf(const char *, ...);";
|
||||||
else if (name[x] == "symbols_nelts")
|
|
||||||
;
|
|
||||||
else
|
else
|
||||||
print "extern int " name[x]"();";
|
print "extern int " name[x]"();";
|
||||||
}
|
}
|
||||||
print;
|
print "\n";
|
||||||
|
|
||||||
sort(name, nname);
|
|
||||||
|
|
||||||
# nname++: An { 0, 0 } entry is added at the end of the vector.
|
# nname++: An { 0, 0 } entry is added at the end of the vector.
|
||||||
print "const int symbols_nelts = " nname+1 ";";
|
print "const int symbols_nelts = " nname+1 ";";
|
||||||
|
|
Loading…
Add table
Reference in a new issue