Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Dec 2024 14:00:45 GMT
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: fa9d4a55d08c - main - devel/9base: fix build on powerpc64
Message-ID:  <202412311400.4BVE0jK9053405@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fa9d4a55d08c3f4d4780f21e01f06ae2288967d2

commit fa9d4a55d08c3f4d4780f21e01f06ae2288967d2
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2024-12-27 22:28:03 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2024-12-31 13:59:53 +0000

    devel/9base: fix build on powerpc64
    
    Fix kcmp() collision with unistd.h:
    sort.c:111:5: error: conflicting types for 'kcmp'
      111 | int     kcmp(Key*, Key*);
          |         ^
    /usr/include/unistd.h:525:6: note: previous declaration is here
      525 | int      kcmp(pid_t pid1, pid_t pid2, int type, uintptr_t idx1, uintptr_t idx2);
          |          ^
    sort.c:205:28: error: too few arguments to function call, expected 5, have 2
      205 |                         n = kcmp(ol->key, l->key);
          |                             ~~~~                ^
---
 devel/9base/files/patch-sort_sort.c | 56 +++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/devel/9base/files/patch-sort_sort.c b/devel/9base/files/patch-sort_sort.c
new file mode 100644
index 000000000000..b4371784981c
--- /dev/null
+++ b/devel/9base/files/patch-sort_sort.c
@@ -0,0 +1,56 @@
+--- sort/sort.c.orig	2024-12-27 22:10:51 UTC
++++ sort/sort.c
+@@ -108,7 +108,7 @@ void	done(char*);
+ void	dokey_m(Key*, uchar*, uchar*, Field*);
+ void	dokey_r(Key*, uchar*, uchar*, Field*);
+ void	done(char*);
+-int	kcmp(Key*, Key*);
++int	kcmp2(Key*, Key*);
+ void	makemapd(Field*);
+ void	makemapm(Field*);
+ void	mergefiles(int, int, Biobuf*);
+@@ -202,7 +202,7 @@ dofile(Biobuf *b)
+ 			l = newline(b);
+ 			if(l == 0)
+ 				break;
+-			n = kcmp(ol->key, l->key);
++			n = kcmp2(ol->key, l->key);
+ 			if(n > 0 || (n == 0 && args.uflag)) {
+ 				fprint(2, "sort: -c file not in sort\n"); /**/
+ 				done("order");
+@@ -448,7 +448,7 @@ mergefiles(int t, int n, Biobuf *b)
+ 			break;
+ 		for(;;) {
+ 			l = m->line;
+-			if(args.uflag && ok && kcmp(ok, l->key) == 0) {
++			if(args.uflag && ok && kcmp2(ok, l->key) == 0) {
+ 				free(l->key);
+ 				free(l);
+ 			} else {
+@@ -467,7 +467,7 @@ mergefiles(int t, int n, Biobuf *b)
+ 			}
+ 			m->line = l;
+ 			m->key = l->key;
+-			if(nn > 1 && kcmp(mmp[0]->key, mmp[1]->key) > 0)
++			if(nn > 1 && kcmp2(mmp[0]->key, mmp[1]->key) > 0)
+ 				break;
+ 		}
+ 	}
+@@ -485,7 +485,7 @@ int
+ }
+ 
+ int
+-kcmp(Key *ka, Key *kb)
++kcmp2(Key *ka, Key *kb)
+ {
+ 	int n, m;
+ 
+@@ -511,7 +511,7 @@ printout(Biobuf *b)
+ 	ok = 0;
+ 	for(n=args.nline; n>0; n--) {
+ 		l = *lp++;
+-		if(args.uflag && ok && kcmp(ok, l->key) == 0)
++		if(args.uflag && ok && kcmp2(ok, l->key) == 0)
+ 			continue;
+ 		lineout(b, l);
+ 		ok = l->key;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412311400.4BVE0jK9053405>