scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 60bf8059f0407bcb238e494abacea39316b08820
parent f3482cc95fff13e99fa2bd4a611c7772b0a15742
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:
Msrc/cmd/addr2line.c | 4++--
Msrc/cmd/as/parser.c | 4++--
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)