* More compiler builtins.

This commit is contained in:
bg- 2007-01-23 12:32:52 +00:00
parent a88f797455
commit 9b075f2038

View File

@ -9,7 +9,16 @@ function sort(V, N, tmp, i, j) {
return; return;
} }
BEGIN { nname = 0; } BEGIN {
nname = 0;
builtin["printf"] = "int printf(const char *, ...)";
builtin["sprintf"] = "int sprintf(char *, const char *, ...)";
builtin["malloc"] = "void *malloc()";
builtin["memcpy"] = "void *memcpy()";
builtin["memset"] = "void *memset()";
builtin["strcpy"] = "char *strcpy()";
builtin[""] = "";
}
/^[0123456789abcdef]+ [ABCDGINRSTUVW] / { /^[0123456789abcdef]+ [ABCDGINRSTUVW] / {
if ($3 != "symbols" && $3 != "symbols_nelts") { if ($3 != "symbols" && $3 != "symbols_nelts") {
@ -25,8 +34,8 @@ END {
# 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 (builtin[name[x]] != "")
print "extern int printf(const char *, ...);"; print builtin[name[x]] ";";
else else
print "extern int " name[x]"();"; print "extern int " name[x]"();";
} }