git: f16e205c6fb9 - stable/13 - jevents: fix bootstrapping on Linux with Clang 16

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Thu, 02 May 2024 20:12:11 UTC
The branch stable/13 has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=f16e205c6fb913b4bca4495bde46a1bdf6339a8c

commit f16e205c6fb913b4bca4495bde46a1bdf6339a8c
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2023-12-12 05:10:14 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2024-05-02 20:11:52 +0000

    jevents: fix bootstrapping on Linux with Clang 16
    
    The glibc fts_open() callback type does not have the second const
    qualifier and it appears that Clang 16 errors by default for mismatched
    function pointer types. Add an ifdef to handle this case.
    
    Reviewed By:    imp, emaste
    Differential Revision: https://reviews.freebsd.org/D43000
    
    (cherry picked from commit 60e845ceef25533bfb60450549bea56a17b1e467)
---
 lib/libpmc/pmu-events/jevents.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/libpmc/pmu-events/jevents.c b/lib/libpmc/pmu-events/jevents.c
index ff7d3b226932..590b465af400 100644
--- a/lib/libpmc/pmu-events/jevents.c
+++ b/lib/libpmc/pmu-events/jevents.c
@@ -1355,7 +1355,11 @@ err_out:
 #include <fts.h>
 
 static int
+#ifdef __GLIBC__
+fts_compare(const FTSENT **a, const FTSENT **b)
+#else
 fts_compare(const FTSENT * const *a, const FTSENT * const *b)
+#endif
 {
 	return (strcmp((*a)->fts_name, (*b)->fts_name));
 }