| 354 return cx_array_insert_sorted_c_(allocator, array, elem_size, sorted_data, |
354 return cx_array_insert_sorted_c_(allocator, array, elem_size, sorted_data, |
| 355 n, cx_cmp_wrap, &wrapper, allow_duplicates); |
355 n, cx_cmp_wrap, &wrapper, allow_duplicates); |
| 356 } |
356 } |
| 357 |
357 |
| 358 #ifndef WITH_QSORT_R |
358 #ifndef WITH_QSORT_R |
| 359 static thread_local cx_compare_func2 cx_array_fn_for_qsort; |
359 static _Thread_local cx_compare_func2 cx_array_fn_for_qsort; |
| 360 static thread_local void *cx_array_context_for_qsort; |
360 static _Thread_local void *cx_array_context_for_qsort; |
| 361 static int cx_array_qsort_wrapper(const void *l, const void *r) { |
361 static int cx_array_qsort_wrapper(const void *l, const void *r) { |
| 362 return cx_array_fn_for_qsort(l, r, cx_array_context_for_qsort); |
362 return cx_array_fn_for_qsort(l, r, cx_array_context_for_qsort); |
| 363 } |
363 } |
| 364 #endif |
364 #endif |
| 365 |
365 |