From 4ff07119e960aee14e03753f808914fa000abe2f Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 13 Jun 2015 11:46:38 +0000 Subject: * file.c (rb_stat_ino): get inode from the interval of struct st. * win32/win32.c (stati64_set_inode): get nFilIndexHigh/Low, and set it to the interval of struct st as inode. * win32/win32.c (stati64_set_inode_handle): call stati64_set_inode. * win32/win32.c (rb_w32_fstati64): call stati64_set_inode_handle. * win32/win32.c (stati64_handle): call stati64_set_inode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'file.c') diff --git a/file.c b/file.c index 28cb3dde6a..a9444029d2 100644 --- a/file.c +++ b/file.c @@ -548,7 +548,18 @@ rb_stat_dev_minor(VALUE self) static VALUE rb_stat_ino(VALUE self) { -#if SIZEOF_STRUCT_STAT_ST_INO > SIZEOF_LONG +#ifdef _WIN32 + struct stat *st = get_stat(self); + unsigned short *p2 = (unsigned short *)st; + unsigned int *p4 = (unsigned int *)st; + uint64_t r; + r = p2[2]; + r <<= 16; + r |= p2[7]; + r <<= 32; + r |= p4[5]; + return ULL2NUM(r); +#elif SIZEOF_STRUCT_STAT_ST_INO > SIZEOF_LONG return ULL2NUM(get_stat(self)->st_ino); #else return ULONG2NUM(get_stat(self)->st_ino); -- cgit v1.2.3