summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-08 12:50:28 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-08 12:50:28 +0000
commitcd476cd86be581cca4ca56ad1277228ea1dc24ee (patch)
tree5deff144b9c8229910e8ebbe309b326bfe405eff /include
parentc7652dec6f9c8cbbbe2953a1c435c12a484773f0 (diff)
* configure.in: check qsort_r(3) and whether it is GNU version.
BSD version has different prototype. * util.h: use qsort_r() as ruby_qsort() if it is GNU version. * util.c: define ruby_qsort() if needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/ruby/util.h b/include/ruby/util.h
index 8443af7..74cdd0f 100644
--- a/include/ruby/util.h
+++ b/include/ruby/util.h
@@ -55,8 +55,12 @@ unsigned long ruby_scan_oct(const char *, size_t, size_t *);
#define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e)))
unsigned long ruby_scan_hex(const char *, size_t, size_t *);
+#ifdef HAVE_GNU_QSORT_R
+# define ruby_qsort qsort_r
+#else
void ruby_qsort(void *, const size_t, const size_t,
int (*)(const void *, const void *, void *), void *);
+#endif
void ruby_setenv(const char *, const char *);
void ruby_unsetenv(const char *);