blob: 41ed2fc2583441b1fc05b73f9d2cb627e23531e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/* ISC license. */
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
#ifndef _BSD_SOURCE
#define _BSD_SOURCE
#endif
#include <stdlib.h>
static int f (void const *a, void const *b, void *c)
{
int aa = *(int const *)a ;
int bb = *(int const *)b ;
(void)c ;
return aa < bb ? -1 : aa > bb ;
}
int main (void)
{
char *arg = "blah" ;
int x[2] = { 2, 1 } ;
qsort_r(x, 2, sizeof(int), arg, &f) ;
return 0 ;
}
|