commit e410bad0b6e2d7f231b821aced3eae16888aca38
parent bb31d7f5c7e1b4b97b2012d9dca26130300cbe72
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 2 Dec 2021 04:38:05 +0100
build: Avoid getline name
There are systems that exposes a function called getline()
even when they are requested to be pure C99 environments.
To avoid problems and simplify the build the name of the
functions getline() are changed to getln() that is a less
clear name but it will generate less conflicts.
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cmd/addr2line.c b/src/cmd/addr2line.c
@@ -49,7 +49,7 @@ addr2line(Obj *obj, char *s)
}
static char *
-getline(void)
+getln(void)
{
size_t len;
static char buf[BUFSIZ];
@@ -130,7 +130,7 @@ main(int argc, char *argv[])
for ( ; *argv; ++argv)
addr2line(obj, *argv);
} else {
- while ((ln = getline()) != NULL)
+ while ((ln = getln()) != NULL)
addr2line(obj, ln);
}
diff --git a/src/cmd/as/parser.c b/src/cmd/as/parser.c
@@ -386,7 +386,7 @@ extract(char *s, size_t len, struct line *lp)
}
static size_t
-getline(FILE *fp, char buff[MAXLINE])
+getln(FILE *fp, char buff[MAXLINE])
{
int c;
char *bp;
@@ -422,7 +422,7 @@ repeat:
delinput();
goto repeat;
}
- n = getline(ip->fp, buff);
+ n = getln(ip->fp, buff);
if (++ip->lineno == 0)
die("as: %s: file too long", infile);
if (n == 0)