aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-07-14 14:25:37 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-07-14 18:35:23 +0900
commitcfc564ac40496a392f463658ea33954ea76d6b11 (patch)
tree09a252c7542f16708789c86906143d9af3495e57 /util.c
parented3d8f74ec2eee43d50f9826e2f11ceea279823e (diff)
downloadruby-cfc564ac40496a392f463658ea33954ea76d6b11.tar.gz
Include headers for `ruby_qsort` only if needed
If GNU `qsort_r` is available, we use the function and these headers are not used.
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index 3d0c61a743..1030c3ecbe 100644
--- a/util.c
+++ b/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/stat.h>
+#include <stdint.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
typedef int (cmpfunc_t)(const void*, const void*, void*);
-#if !defined HAVE_GNU_QSORT_R
#if defined HAVE_QSORT_S && defined RUBY_MSVCRT_VERSION
/* In contrast to its name, Visual Studio qsort_s is incompatible with
* C11 in the order of the comparison function's arguments, and same