aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-10-18 16:06:44 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-10-18 16:06:44 +0000
commite44ba034e73fa73b2e888b52b83419c54fec27f9 (patch)
tree6cab219214157ea95de7b9076373c5274db1ea82 /mandocdb.c
parentb2605db9a7a1fdd7d3289acf2afd01ccb7e8668a (diff)
downloadmandoc-e44ba034e73fa73b2e888b52b83419c54fec27f9.tar.gz
mandoc-e44ba034e73fa73b2e888b52b83419c54fec27f9.tar.zst
mandoc-e44ba034e73fa73b2e888b52b83419c54fec27f9.zip
Compat glue for the FreeBSD comparison function prototype for fts_open(3)
which differs from what most other systems use. While here, improve diagnostic output of ./configure tests.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 7e7ccd90..16bb4c9a 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.231 2016/10/18 14:15:33 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.232 2016/10/18 16:06:44 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -120,7 +120,11 @@ static void dbadd_mlink(const struct mlink *mlink);
static void dbprune(struct dba *);
static void dbwrite(struct dba *);
static void filescan(const char *);
+#if HAVE_FTS_COMPARE_CONST
+static int fts_compare(const FTSENT *const *, const FTSENT *const *);
+#else
static int fts_compare(const FTSENT **, const FTSENT **);
+#endif
static void mlink_add(struct mlink *, const struct stat *);
static void mlink_check(struct mpage *, struct mlink *);
static void mlink_free(struct mlink *);
@@ -547,7 +551,11 @@ usage:
* at the beginning, process directory entries in reverse alpha order.
*/
static int
+#if HAVE_FTS_COMPARE_CONST
+fts_compare(const FTSENT *const *a, const FTSENT *const *b)
+#else
fts_compare(const FTSENT **a, const FTSENT **b)
+#endif
{
return -strcmp((*a)->fts_name, (*b)->fts_name);
}