Skip to content

Commit d8e5c64

Browse files
committed
Merge pull request #3518 from rubinius/2.2
WIP: 2.2 compat
2 parents 6b35d17 + 649739c commit d8e5c64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1386
-332
lines changed

configure

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,46 @@ int main() { return tgetnum(""); }
12391239
@defines << "HAVE_GETTID"
12401240
end
12411241

1242+
if has_struct_member("stat", "st_atim", ["sys/stat.h"])
1243+
@defines << "HAVE_STRUCT_STAT_ST_ATIM"
1244+
end
1245+
1246+
if has_struct_member("stat", "st_atimespec", ["sys/stat.h"])
1247+
@defines << "HAVE_STRUCT_STAT_ST_ATIMESPEC"
1248+
end
1249+
1250+
if has_struct_member("stat", "st_atimensec", ["sys/stat.h"])
1251+
@defines << "HAVE_STRUCT_STAT_ST_ATIMENSEC"
1252+
end
1253+
1254+
if has_struct_member("stat", "st_mtim", ["sys/stat.h"])
1255+
@defines << "HAVE_STRUCT_STAT_ST_MTIM"
1256+
end
1257+
1258+
if has_struct_member("stat", "st_mtimespec", ["sys/stat.h"])
1259+
@defines << "HAVE_STRUCT_STAT_ST_MTIMESPEC"
1260+
end
1261+
1262+
if has_struct_member("stat", "st_mtimensec", ["sys/stat.h"])
1263+
@defines << "HAVE_STRUCT_STAT_ST_MTIMENSEC"
1264+
end
1265+
1266+
if has_struct_member("stat", "st_ctim", ["sys/stat.h"])
1267+
@defines << "HAVE_STRUCT_STAT_ST_CTIM"
1268+
end
1269+
1270+
if has_struct_member("stat", "st_ctimespec", ["sys/stat.h"])
1271+
@defines << "HAVE_STRUCT_STAT_ST_CTIMESPEC"
1272+
end
1273+
1274+
if has_struct_member("stat", "st_ctimensec", ["sys/stat.h"])
1275+
@defines << "HAVE_STRUCT_STAT_ST_CTIMENSEC"
1276+
end
1277+
1278+
if has_struct_member("stat", "st_birthtimespec", ["sys/stat.h"])
1279+
@defines << "HAVE_ST_BIRTHTIME"
1280+
end
1281+
12421282
# glibc has useless lchmod() so we don't try to use lchmod() on linux
12431283
if !@linux and has_function("lchmod", ["sys/stat.h", "unistd.h"])
12441284
@have_lchmod = true

kernel/bootstrap/stat.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ def ctime
8787
raise PrimitiveFailure, "Rubinius::Stat#ctime primitive failed"
8888
end
8989

90+
def birthtime
91+
Rubinius.primitive :stat_birthtime
92+
raise NotImplementedError, "birthtime() function is unimplemented on this machine"
93+
end
94+
9095
def inspect
9196
"#<#{self.class.name} dev=0x#{self.dev.to_s(16)}, ino=#{self.ino}, " \
9297
"mode=#{sprintf("%07d", self.mode.to_s(8).to_i)}, nlink=#{self.nlink}, " \

kernel/common/binding.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ class Binding
33
attr_accessor :compiled_code
44
attr_accessor :constant_scope
55
attr_accessor :proc_environment
6-
attr_accessor :self
76
attr_accessor :location
7+
attr_accessor :receiver
88

99
def from_proc?
1010
@proc_environment
@@ -29,7 +29,7 @@ def self.self_context(recv, variables)
2929
def self.setup(variables, code, constant_scope, recv=nil, location=nil)
3030
bind = allocate()
3131

32-
bind.self = self_context(recv, variables)
32+
bind.receiver = self_context(recv, variables)
3333
bind.variables = variables
3434
bind.compiled_code = code
3535
bind.constant_scope = constant_scope
@@ -54,4 +54,8 @@ def eval(expr, filename=nil, lineno=nil)
5454

5555
Kernel.eval(expr, self, filename, lineno)
5656
end
57+
58+
def local_variables
59+
variables.local_variables
60+
end
5761
end

kernel/common/dir.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ def each
174174
self
175175
end
176176

177+
def fileno
178+
Rubinius.primitive :dir_fileno
179+
raise PrimitiveFailure, "Dir#fileno primitive failed"
180+
end
181+
177182
attr_reader :path
178183

179184
alias_method :to_path, :path

0 commit comments

Comments
 (0)