+2021-12-24 Bruno Haible <bruno@clisp.org>
+
+ search: Fix compilation errors with SunPRO C++ on Solaris 10.
+ * lib/search.in.h (_gl_lsearch_compar_fn): New type.
+ (lfind, lsearch): Use it.
+
2021-12-24 Bruno Haible <bruno@clisp.org>
qsort_r: Fix compilation error with SunPRO C++ on Solaris 10.
/* The definition of _GL_WARN_ON_USE is copied here. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if !GNULIB_defined_lsearch_fn_types
+typedef int (*_gl_lsearch_compar_fn) (const void *, const void *);
+# define GNULIB_defined_lsearch_fn_types 1
+#endif
+#ifdef __cplusplus
+}
+#endif
+
#if @GNULIB_MDA_LFIND@
/* On native Windows, map 'lfind' to '_lfind', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
_GL_CXXALIAS_MDA (lfind, void *,
(const void *key, const void *base, unsigned int *nmemb,
unsigned int size,
- int (*compar) (const void *, const void *)));
+ _gl_lsearch_compar_fn compar));
# else
_GL_CXXALIAS_SYS (lfind, void *,
(const void *key, const void *base, size_t *nmemb,
size_t size,
- int (*compar) (const void *, const void *)));
+ _gl_lsearch_compar_fn compar));
# endif
_GL_CXXALIASWARN (lfind);
#endif
_GL_CXXALIAS_MDA (lsearch, void *,
(const void *key, void *base, unsigned int *nmemb,
unsigned int size,
- int (*compar) (const void *, const void *)));
+ _gl_lsearch_compar_fn compar));
# else
_GL_CXXALIAS_SYS (lsearch, void *,
(const void *key, void *base, size_t *nmemb,
size_t size,
- int (*compar) (const void *, const void *)));
+ _gl_lsearch_compar_fn compar));
# endif
_GL_CXXALIASWARN (lsearch);
#endif