33 |
33 |
34 #include <string.h> |
34 #include <string.h> |
35 #include <stdlib.h> |
35 #include <stdlib.h> |
36 |
36 |
37 #ifndef UCX_ARRAY_DISABLE_QSORT |
37 #ifndef UCX_ARRAY_DISABLE_QSORT |
38 #if defined(__GLIBC__) |
38 #ifdef __GLIBC__ |
39 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) |
39 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) |
40 #define ucx_array_sort_impl qsort_r |
40 #define ucx_array_sort_impl qsort_r |
41 #endif /* glibc version >= 2.8 */ |
41 #endif /* glibc version >= 2.8 */ |
42 #endif /* __GLIBC__ */ |
42 #elif /* not __GLIBC__ */ defined(__APPLE__) || defined(__FreeBSD__) |
43 |
|
44 #if defined(__APPLE__) || defined(__FreeBSD__) |
|
45 #define ucx_array_sort_impl ucx_qsort_r |
43 #define ucx_array_sort_impl ucx_qsort_r |
46 #define USE_UCX_QSORT_R |
44 #define USE_UCX_QSORT_R |
47 #endif /* __APLE__ or __FreeBSD__ */ |
45 #endif /* __GLIBC__, __APLE__, __FreeBSD__ */ |
48 #endif /* UCX_ARRAY_DISABLE_QSORT */ |
46 #endif /* UCX_ARRAY_DISABLE_QSORT */ |
49 |
47 |
50 #ifndef ucx_array_sort_impl |
48 #ifndef ucx_array_sort_impl |
51 #define ucx_array_sort_impl ucx_mergesort |
49 #define ucx_array_sort_impl ucx_mergesort |
52 #endif |
50 #endif |