From 9e2defbba8a36e840b4bbb9f322f9a3debc388d8 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 18 Jul 2022 00:08:45 +0200 Subject: [PATCH] Make ysfx compatible with FreeBSD --- source/modules/ysfx/sources/ysfx_utils_fts.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/modules/ysfx/sources/ysfx_utils_fts.cpp b/source/modules/ysfx/sources/ysfx_utils_fts.cpp index a836b50c1..2226a3548 100644 --- a/source/modules/ysfx/sources/ysfx_utils_fts.cpp +++ b/source/modules/ysfx/sources/ysfx_utils_fts.cpp @@ -36,7 +36,13 @@ void visit_directories(const char *rootpath, bool (*visit)(const std::string &, #ifndef __EMSCRIPTEN__ char *argv[] = {(char *)rootpath, nullptr}; - auto compar = [](const FTSENT **a, const FTSENT **b) -> int { +#if !defined(__FreeBSD__) + using compar_arg_t = const FTSENT **; +#else + using compar_arg_t = const FTSENT *const *; +#endif + + auto compar = [](compar_arg_t a, compar_arg_t b) -> int { return strcmp((*a)->fts_name, (*b)->fts_name); };