diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-23 04:31:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-23 04:31:09 +0000 |
commit | c5fef27312bdf014eaf408ec488d03b7fad5a9d3 (patch) | |
tree | 5ce6f9ce415a80898caf6cceb217da3a27fc4306 | |
parent | 3254b0f3c1c34119949839e855420defbac03d85 (diff) | |
download | ruby-c5fef27312bdf014eaf408ec488d03b7fad5a9d3.tar.gz |
file.c: unpack in binary
* file.c (statfs_fsid): convert with rb_integer_unpack.
* configure.in: fsid_t is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | configure.in | 10 | ||||
-rw-r--r-- | file.c | 13 | ||||
-rw-r--r-- | win32/Makefile.sub | 1 |
3 files changed, 3 insertions, 21 deletions
diff --git a/configure.in b/configure.in index 410b86b634..8a9254d738 100644 --- a/configure.in +++ b/configure.in @@ -1061,7 +1061,6 @@ main() ac_cv_func_malloc_usable_size=no ac_cv_type_struct_statfs=yes ac_cv_member_struct_statfs_f_fstypename=yes - ac_cv_type_fsid_t=yes { test "$target_cpu" = x64 && ac_cv_func___builtin_setjmp=no; } AC_CHECK_TYPE([NET_LUID], [], [], [@%:@include <windows.h> @@ -1743,15 +1742,6 @@ AC_CHECK_MEMBERS([struct statfs.f_fstypename], [], [], [@%:@ifdef HAVE_SYS_PARAM @%:@ifdef HAVE_SYS_VFS_H @%:@ include <sys/vfs.h> @%:@endif]) -AC_CHECK_TYPES([fsid_t], [], [], [@%:@ifdef HAVE_SYS_PARAM_H -@%:@ include <sys/param.h> -@%:@endif -@%:@ifdef HAVE_SYS_MOUNT_H -@%:@ include <sys/mount.h> -@%:@endif -@%:@ifdef HAVE_SYS_VFS_H -@%:@ include <sys/vfs.h> -@%:@endif]) ]) AC_CHECK_TYPES([clockid_t], [], [], [@%:@ifdef HAVE_TIME_H @@ -5540,16 +5540,9 @@ statfs_ffree(VALUE self) static VALUE statfs_fsid(VALUE self) { -#ifdef HAVE_FSID_T - union { - uint64_t v; - fsid_t f; - } n = {0}; - n.f = get_statfs(self)->f_fsid; - return LL2NUM(n.v); -#else - return LONG2NUM(get_statfs(self)->f_fsid); -#endif + return rb_integer_unpack(&get_statfs(self)->f_fsid, + 1, sizeof(get_statfs(self)->f_fsid), + 0, INTEGER_PACK_2COMP|INTEGER_PACK_NATIVE_BYTE_ORDER); } #ifdef HAVE_STRUCT_STATFS_F_FSTYPENAME diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 02de48ce36..5a8479affb 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -701,7 +701,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #define HAVE_RB_FD_INIT 1 #define HAVE_STRUCT_STATFS 1 #define HAVE_STRUCT_STATFS_F_FSTYPENAME 1 -#define HAVE_FSID_T 1 #define RUBY_SETJMP(env) _setjmp(env) #define RUBY_LONGJMP(env,val) longjmp(env,val) #define RUBY_JMP_BUF jmp_buf |