shithub: scc

Download patch

ref: e410bad0b6e2d7f231b821aced3eae16888aca38
parent: bb31d7f5c7e1b4b97b2012d9dca26130300cbe72
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Dec 1 23:38:05 EST 2021

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.

--- a/src/cmd/addr2line.c
+++ b/src/cmd/addr2line.c
@@ -49,7 +49,7 @@
 }
 
 static char *
-getline(void)
+getln(void)
 {
 	size_t len;
 	static char buf[BUFSIZ];
@@ -130,7 +130,7 @@
 		for ( ; *argv; ++argv)
 			addr2line(obj, *argv);
 	} else {
-		while ((ln = getline()) != NULL)
+		while ((ln = getln()) != NULL)
 			addr2line(obj, ln);
 	}
 
--- a/src/cmd/as/parser.c
+++ b/src/cmd/as/parser.c
@@ -386,7 +386,7 @@
 }
 
 static size_t
-getline(FILE *fp, char buff[MAXLINE])
+getln(FILE *fp, char buff[MAXLINE])
 {
 	int c;
 	char *bp;
@@ -422,7 +422,7 @@
 		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)