git: dbbbe6f393dd - stable/13 - mandoc: fix bootstrapping on Linux with Clang 16

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

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

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

    mandoc: fix bootstrapping on Linux with Clang 16
    
    It appears that Clang 16 errors by default for the mismatched function
    pointer types that are triggered by the fts callback (since glibc has a
    callback type without the second const qualifier).
    Fortunately, there is already code to handle glibc inside mandoc, we
    just have to edit the checked-in config.h.
    
    Reviewed By:    imp, emaste
    Differential Revision: https://reviews.freebsd.org/D42999
    
    (cherry picked from commit 0156465c6d11e1ef064d104443047e4146e5b925)
---
 contrib/mandoc/config.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/mandoc/config.h b/contrib/mandoc/config.h
index 553c4c8b7400..213513f1c87e 100644
--- a/contrib/mandoc/config.h
+++ b/contrib/mandoc/config.h
@@ -13,7 +13,11 @@
 #define HAVE_ENDIAN 0
 #define HAVE_ERR 1
 #define HAVE_FTS 1
+#ifdef __GLIBC__
+#define HAVE_FTS_COMPARE_CONST 0
+#else
 #define HAVE_FTS_COMPARE_CONST 1
+#endif
 #define HAVE_GETLINE 1
 #define HAVE_GETSUBOPT 1
 #define HAVE_ISBLANK 1