aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-08-31 21:55:25 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2020-08-31 21:55:25 +0000
commitd10af81d2defe43db0db0a7dca3eefb047bd8ddc (patch)
tree74cf1fc9ca469efeb2cdbd41ae1cc6383a228672 /lib
parent8df7e154a28b7d0ca90e9fa01873dcb9e16fc1b3 (diff)
downloadsrc-d10af81d2defe43db0db0a7dca3eefb047bd8ddc.tar.gz
src-d10af81d2defe43db0db0a7dca3eefb047bd8ddc.zip
Fix the build of scandir_b with GCC.
Use explicit typedefs for block thunk structures as in r264143. Reviewed by: kib, adrian MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26256
Notes
Notes: svn path=/head/; revision=365012
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/scandir.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c
index 2b8d244bcc59..10cd7633dac1 100644
--- a/lib/libc/gen/scandir.c
+++ b/lib/libc/gen/scandir.c
@@ -56,15 +56,18 @@ void qsort_b(void *, size_t, size_t, void *);
#define SELECT(x) select(x)
#endif
-#ifndef I_AM_SCANDIR_B
+#ifdef I_AM_SCANDIR_B
+typedef DECLARE_BLOCK(int, select_block, const struct dirent *);
+typedef DECLARE_BLOCK(int, dcomp_block, const struct dirent **,
+ const struct dirent **);
+#else
static int alphasort_thunk(void *thunk, const void *p1, const void *p2);
#endif
int
#ifdef I_AM_SCANDIR_B
-scandir_b(const char *dirname, struct dirent ***namelist,
- DECLARE_BLOCK(int, select, const struct dirent *),
- DECLARE_BLOCK(int, dcomp, const struct dirent **, const struct dirent **))
+scandir_b(const char *dirname, struct dirent ***namelist, select_block select,
+ dcomp_block dcomp)
#else
scandir(const char *dirname, struct dirent ***namelist,
int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **,