# HG changeset patch # User Olaf Wintermann # Date 1565213038 -7200 # Node ID 3b9b4f6e9fd62aee9c2b34d313daa134b4a52055 # Parent 62660a4875c9498bb0cc2cf36b70f6134cc05836 use qsort_s on solaris diff -r 62660a4875c9 -r 3b9b4f6e9fd6 src/array.c --- a/src/array.c Wed Aug 07 21:44:35 2019 +0200 +++ b/src/array.c Wed Aug 07 23:23:58 2019 +0200 @@ -27,6 +27,8 @@ */ #define _GNU_SOURCE /* we want to use qsort_r(), if available */ +#define __STDC_WANT_LIB_EXT1__ 1 /* use qsort_s, if available */ + #include "ucx/array.h" #include "ucx/utils.h" @@ -42,7 +44,11 @@ #elif /* not __GLIBC__ */ defined(__APPLE__) || defined(__FreeBSD__) #define ucx_array_sort_impl ucx_qsort_r #define USE_UCX_QSORT_R -#endif /* __GLIBC__, __APLE__, __FreeBSD__ */ +#elif /* not (__APPLE || __FreeBSD__) */ defined(__sun) +#if __STDC_VERSION__ >= 201112L +#define ucx_array_sort_impl qsort_s +#endif +#endif /* __GLIBC__, __APLE__, __FreeBSD__, __sun */ #endif /* UCX_ARRAY_DISABLE_QSORT */ #ifndef ucx_array_sort_impl @@ -298,7 +304,7 @@ }; static int cmp_func_swap_args(void *data, const void *x, const void *y) { - struct cmpfnc_swapargs_info* info = data; + cmpfnc_swapargs_info* info = data; return info->func(x, y, info->data); }