diff options
Diffstat (limited to 'src/sysdeps/tryqsortr_freebsd.c')
| -rw-r--r-- | src/sysdeps/tryqsortr_freebsd.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sysdeps/tryqsortr_freebsd.c b/src/sysdeps/tryqsortr_freebsd.c index 6bf090a..41ed2fc 100644 --- a/src/sysdeps/tryqsortr_freebsd.c +++ b/src/sysdeps/tryqsortr_freebsd.c @@ -1,19 +1,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 *)a ; - int bb = *(int *)b ; + int aa = *(int const *)a ; + int bb = *(int const *)b ; (void)c ; return aa < bb ? -1 : aa > bb ; } int main (void) { - char *x = "blah" ; + char *arg = "blah" ; int x[2] = { 2, 1 } ; - qsort_r(x, 2, sizeof(int), x, &f) ; + qsort_r(x, 2, sizeof(int), arg, &f) ; return 0 ; } |
