path: root/util.c
diff options
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-11 08:18:56 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-11 08:18:56 (GMT)
commitbe4b1c1e2c55fb812d6ad2b9d88c5357e06a9f9e (patch)
tree5352fc82b67f50120c5272353eea60a327d60400 /util.c
parentd22cf0de18178ce38cb64a434983047f2e62eac5 (diff)
util.c: qsort_s
* util.c (ruby_qsort): use qsort_s if available, for Microsoft Visual Studio 2005 (msvcr80.dll) and mingw. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
1 files changed, 5 insertions, 0 deletions
diff --git a/util.c b/util.c
index 5c89eb6..8c428b5 100644
--- a/util.c
+++ b/util.c
@@ -191,6 +191,11 @@ ruby_strtoul(const char *str, char **endptr, int base)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#if !defined HAVE_BSD_QSORT_R && defined HAVE_QSORT_S
+# define qsort_r(base, nel, size, arg, cmp) qsort_s(base, nel, size, cmp, arg)
+# define cmp_bsd_qsort cmp_ms_qsort
+# define HAVE_BSD_QSORT_R 1
#if defined HAVE_BSD_QSORT_R
typedef int (cmpfunc_t)(const void*, const void*, void*);