summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/util.c b/util.c
index 74f2d11b94..3c08879ce5 100644
--- a/util.c
+++ b/util.c
@@ -13,6 +13,10 @@
# define MINGW_HAS_SECURE_API 1
#endif
+#ifndef __STDC_WANT_LIB_EXT1__
+#define __STDC_WANT_LIB_EXT1__ 1 /* for qsort_s() */
+#endif
+
#include "ruby/internal/config.h"
#include <ctype.h>
@@ -203,22 +207,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
-#if defined(HAVE_FCNTL_H)
-#include <fcntl.h>
-#endif
-
-#ifndef S_ISDIR
-# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#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