summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2024-05-21 13:25:08 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-05-21 14:06:43 +0900
commit122b510b94f815473cc5cc1d47701a06a0bc44a0 (patch)
tree14b5d81a3fb37e40a8647762245fe70dd9b83cf5
parentcbc84b8060ca32a982d21e44b32c185da6d7d7a5 (diff)
merge revision(s) 7400628cb054a9a9651d69411a100fc9d518099f:
[Bug #18997] Don't define ruby_qsort when POSIX qsort_r is available The current code would define ruby_qsort as a wrapper of qsort_s when it is available. When both qsort_s and POSIX (GNU) qsort_r are available, we should call qsort_r directly instead, and the qsort_s wrapper is redundant. --- util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
-rw-r--r--util.c6
-rw-r--r--version.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/util.c b/util.c
index 1b11ecb3f5..d2fa329a94 100644
--- a/util.c
+++ b/util.c
@@ -218,6 +218,7 @@ ruby_strtoul(const char *str, char **endptr, int base)
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
@@ -263,7 +264,7 @@ ruby_qsort(void* base, const size_t nel, const size_t size, cmpfunc_t *cmp, void
qsort_s(base, nel, size, cmp, d);
}
# define HAVE_GNU_QSORT_R 1
-#elif !defined HAVE_GNU_QSORT_R
+#else
/* mm.c */
#define mmtype long
@@ -530,7 +531,8 @@ ruby_qsort(void* base, const size_t nel, const size_t size, cmpfunc_t *cmp, void
else goto nxt; /* need not to sort both sides */
}
}
-#endif /* HAVE_GNU_QSORT_R */
+#endif
+#endif /* !HAVE_GNU_QSORT_R */
char *
ruby_strdup(const char *str)
diff --git a/version.h b/version.h
index c24c8b0ad1..84ac0ec730 100644
--- a/version.h
+++ b/version.h
@@ -11,11 +11,11 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 5
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 252
+#define RUBY_PATCHLEVEL 253
#define RUBY_RELEASE_YEAR 2024
#define RUBY_RELEASE_MONTH 5
-#define RUBY_RELEASE_DAY 17
+#define RUBY_RELEASE_DAY 21
#include "ruby/version.h"