Include headers for ruby_qsort
only if needed
If GNU `qsort_r` is available, we use the function and these headers are not used.
This commit is contained in:
parent
ed3d8f74ec
commit
cfc564ac40
Notes:
git
2023-07-14 09:35:42 +00:00
4
util.c
4
util.c
@ -203,15 +203,15 @@ ruby_strtoul(const char *str, char **endptr, int base)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined HAVE_GNU_QSORT_R
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <stdint.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef int (cmpfunc_t)(const void*, const void*, void*);
|
typedef int (cmpfunc_t)(const void*, const void*, void*);
|
||||||
|
|
||||||
#if !defined HAVE_GNU_QSORT_R
|
|
||||||
#if defined HAVE_QSORT_S && defined RUBY_MSVCRT_VERSION
|
#if defined HAVE_QSORT_S && defined RUBY_MSVCRT_VERSION
|
||||||
/* In contrast to its name, Visual Studio qsort_s is incompatible with
|
/* In contrast to its name, Visual Studio qsort_s is incompatible with
|
||||||
* C11 in the order of the comparison function's arguments, and same
|
* C11 in the order of the comparison function's arguments, and same
|
||||||
|
Loading…
x
Reference in New Issue
Block a user