git: 8c94ed992702 - main - bsearch_b: fix compilation with gcc
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Mar 2024 19:46:19 UTC
The branch main has been updated by brooks:
URL: https://cgit.FreeBSD.org/src/commit/?id=8c94ed99270292262073b7bd103a29de69b5ae38
commit 8c94ed99270292262073b7bd103a29de69b5ae38
Author: Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2024-03-06 19:45:40 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-03-06 19:46:12 +0000
bsearch_b: fix compilation with gcc
Reported by: rscheff
Differential Revision: https://reviews.freebsd.org/D44256
---
lib/libc/stdlib/bsearch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/libc/stdlib/bsearch.c b/lib/libc/stdlib/bsearch.c
index 055becf1c85b..96c728e1c997 100644
--- a/lib/libc/stdlib/bsearch.c
+++ b/lib/libc/stdlib/bsearch.c
@@ -35,6 +35,7 @@
#ifdef I_AM_BSEARCH_B
#include "block_abi.h"
#define COMPAR(x,y) CALL_BLOCK(compar, x, y)
+typedef DECLARE_BLOCK(int, compar_block, const void *, const void *);
#else
#define COMPAR(x,y) compar(x, y)
#endif
@@ -58,7 +59,7 @@
#ifdef I_AM_BSEARCH_B
void *
bsearch_b(const void *key, const void *base0, size_t nmemb, size_t size,
- DECLARE_BLOCK(int, compar, const void *, const void *))
+ compar_block compar)
#else
void *
bsearch(const void *key, const void *base0, size_t nmemb, size_t size,