Skip to content

Commit 4c5d14f

Browse files
authored
Merge pull request ruby#89 from Shopify/merge_upstream
Merge upstream Ruby
2 parents ecf7095 + aa7894c commit 4c5d14f

36 files changed

+1022
-445
lines changed

common.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ exts-note: $(EXTS_MK)
311311
$(Q)$(MAKE) $(EXTS_NOTE)
312312

313313
ext/extinit.c: $(srcdir)/template/extinit.c.tmpl $(PREP)
314+
$(MAKEDIRS) $(@D)
314315
$(Q)$(MINIRUBY) $(tooldir)/generic_erb.rb -o $@ -c \
315316
$(srcdir)/template/extinit.c.tmpl $(EXTINITS)
316317

@@ -8378,8 +8379,8 @@ miniinit.$(OBJEXT): {$(VPATH)}mini_builtin.c
83788379
miniinit.$(OBJEXT): {$(VPATH)}miniinit.c
83798380
miniinit.$(OBJEXT): {$(VPATH)}miniprelude.c
83808381
miniinit.$(OBJEXT): {$(VPATH)}missing.h
8381-
miniinit.$(OBJEXT): {$(VPATH)}node.h
83828382
miniinit.$(OBJEXT): {$(VPATH)}nilclass.rb
8383+
miniinit.$(OBJEXT): {$(VPATH)}node.h
83838384
miniinit.$(OBJEXT): {$(VPATH)}numeric.rb
83848385
miniinit.$(OBJEXT): {$(VPATH)}onigmo.h
83858386
miniinit.$(OBJEXT): {$(VPATH)}oniguruma.h
@@ -8637,8 +8638,10 @@ mjit.$(OBJEXT): {$(VPATH)}thread_native.h
86378638
mjit.$(OBJEXT): {$(VPATH)}util.h
86388639
mjit.$(OBJEXT): {$(VPATH)}vm_callinfo.h
86398640
mjit.$(OBJEXT): {$(VPATH)}vm_core.h
8641+
mjit.$(OBJEXT): {$(VPATH)}vm_debug.h
86408642
mjit.$(OBJEXT): {$(VPATH)}vm_opts.h
86418643
mjit.$(OBJEXT): {$(VPATH)}yjit.h
8644+
mjit.$(OBJEXT): {$(VPATH)}vm_sync.h
86428645
mjit_build_dir.$(OBJEXT): {$(VPATH)}config.h
86438646
mjit_build_dir.$(OBJEXT): {$(VPATH)}internal/compiler_is.h
86448647
mjit_build_dir.$(OBJEXT): {$(VPATH)}internal/compiler_is/apple.h

configure.ac

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,15 @@ AS_IF([test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"], [
135135
AC_MSG_ERROR(cached CC is different -- throw away $cache_file
136136
(it is also a good idea to do 'make clean' before compiling))
137137
])
138-
AS_CASE(["${build_os}"], [linux*|cygwin*|msys*], [
138+
AS_CASE(["${build_os}"],
139+
[linux*|cygwin*|msys*], [
140+
# Naruse prefers GCC on Linux
139141
AC_CHECK_TOOLS([CC], [gcc clang cc])
142+
],
143+
[solaris*], [
144+
# Clang on Solaris is largely untested.
145+
# https://bugs.ruby-lang.org/issues/17949
146+
AC_CHECK_TOOLS([CC], [cc gcc])
140147
], [
141148
# OpenBSD wants to prefer cc over gcc.
142149
# See https://github.com/ruby/ruby/pull/2443
@@ -2755,6 +2762,36 @@ AS_IF([test "x$rb_cv_const_page_size" = xyes],
27552762
[AC_DEFINE(HAVE_CONST_PAGE_SIZE, 1)],
27562763
[AC_DEFINE(HAVE_CONST_PAGE_SIZE, 0)]
27572764
)
2765+
2766+
AS_IF([test "x$ac_cv_func_ioctl" = xyes], [
2767+
AC_CACHE_CHECK([ioctl request type], rb_cv_ioctl_request_type,
2768+
[rb_cv_ioctl_request_type=no
2769+
dnl corresponding NUM2IOCTLREQ needs to be defined
2770+
for type in "unsigned long:ULONG_MAX" int:INT_MAX; do
2771+
max=`echo $type | sed 's/.*://'`
2772+
type=`echo $type | sed 's/:.*//'`
2773+
RUBY_WERROR_FLAG([
2774+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2775+
@%:@include <limits.h>
2776+
@%:@include <sys/types.h>
2777+
@%:@if defined(HAVE_SYS_IOCTL_H) && !defined(_WIN32)
2778+
@%:@include <sys/ioctl.h>
2779+
@%:@endif
2780+
]], [[
2781+
$type req = $max;
2782+
if (ioctl(0, req)) {/* do nothing*/};
2783+
]])],
2784+
[rb_cv_ioctl_request_type="$type"])
2785+
])
2786+
test "x$rb_cv_ioctl_request_type" = xno || break
2787+
done])
2788+
AS_CASE(["$rb_cv_ioctl_request_type"], [no|int], [],
2789+
["unsigned long"], [
2790+
AC_DEFINE_UNQUOTED(IOCTL_REQ_TYPE, [$rb_cv_ioctl_request_type])
2791+
AC_DEFINE_UNQUOTED(NUM2IOCTLREQ(num), [NUM2ULONG(num)])
2792+
])
2793+
])
2794+
27582795
}
27592796

27602797
: "runtime section" && {

cont.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ rb_fiber_s_scheduler(VALUE klass)
20002000
* Fiber.current_scheduler -> obj or nil
20012001
*
20022002
* Returns the Fiber scheduler, that was last set for the current thread with Fiber.set_scheduler
2003-
* iff the current fiber is non-blocking.
2003+
* if and only if the current fiber is non-blocking.
20042004
*
20052005
*/
20062006
static VALUE

doc/fiber.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ class Scheduler
9090
def timeout_after(duration, klass, *arguments, &block)
9191
end
9292

93+
# Resolve hostname to an array of IP addresses.
94+
# This hook is optional.
95+
# @parameter hostname [String] Example: "www.ruby-lang.org".
96+
# @returns [Array] An array of IPv4 and/or IPv6 address strings that the hostname resolves to.
97+
def address_resolve(hostname)
98+
end
99+
93100
# Block the calling fiber.
94101
# @parameter blocker [Object] What we are waiting on, informational only.
95102
# @parameter timeout [Numeric | Nil] The amount of time to wait for in seconds.

ext/-test-/cxxanyargs/extconf.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
ok = cxx.try_link(<<~'begin', "") do |x|
1313
#include "ruby/config.h"
1414
15+
#ifdef RUBY_ALTERNATIVE_MALLOC_HEADER
16+
# include RUBY_ALTERNATIVE_MALLOC_HEADER
17+
#endif
18+
1519
namespace {
1620
typedef int conftest1[SIZEOF_LONG == sizeof(long) ? 1 : -1];
1721
typedef int conftest2[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];

ext/digest/sha2/sha2.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
575575
usedspace = freespace = 0;
576576
}
577577

578-
int SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
578+
int SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context) {
579579
sha2_word32 *d = (sha2_word32*)digest;
580580
unsigned int usedspace;
581581

@@ -640,7 +640,7 @@ int SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
640640
return 1;
641641
}
642642

643-
char *SHA256_End(SHA256_CTX* context, char buffer[]) {
643+
char *SHA256_End(SHA256_CTX* context, char buffer[SHA256_DIGEST_STRING_LENGTH]) {
644644
sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest;
645645
int i;
646646

@@ -943,7 +943,7 @@ void SHA512_Last(SHA512_CTX* context) {
943943
SHA512_Transform(context, (sha2_word64*)context->buffer);
944944
}
945945

946-
int SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
946+
int SHA512_Final(sha2_byte digest[SHA512_DIGEST_LENGTH], SHA512_CTX* context) {
947947
sha2_word64 *d = (sha2_word64*)digest;
948948

949949
/* Sanity check: */
@@ -973,7 +973,7 @@ int SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
973973
return 1;
974974
}
975975

976-
char *SHA512_End(SHA512_CTX* context, char buffer[]) {
976+
char *SHA512_End(SHA512_CTX* context, char buffer[SHA512_DIGEST_STRING_LENGTH]) {
977977
sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest;
978978
int i;
979979

@@ -1019,7 +1019,7 @@ void SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) {
10191019
SHA512_Update((SHA512_CTX*)context, data, len);
10201020
}
10211021

1022-
int SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
1022+
int SHA384_Final(sha2_byte digest[SHA384_DIGEST_LENGTH], SHA384_CTX* context) {
10231023
sha2_word64 *d = (sha2_word64*)digest;
10241024

10251025
/* Sanity check: */
@@ -1049,7 +1049,7 @@ int SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
10491049
return 1;
10501050
}
10511051

1052-
char *SHA384_End(SHA384_CTX* context, char buffer[]) {
1052+
char *SHA384_End(SHA384_CTX* context, char buffer[SHA384_DIGEST_STRING_LENGTH]) {
10531053
sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest;
10541054
int i;
10551055

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy