[前][次][番号順一覧][スレッド一覧]

ruby-changes:33597

From: nobu <ko1@a...>
Date: Wed, 23 Apr 2014 11:32:22 +0900 (JST)
Subject: [ruby-changes:33597] nobu:r45678 (trunk): file.c: fsid_t may not be defined

nobu	2014-04-23 11:32:17 +0900 (Wed, 23 Apr 2014)

  New Revision: 45678

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45678

  Log:
    file.c: fsid_t may not be defined
    
    * configure.in: check if fsid_t is defined.
    
    * file.c (statfs_fsid): fsid_t may not be defined, assume long in
      that case.

  Modified files:
    trunk/configure.in
    trunk/file.c
Index: configure.in
===================================================================
--- configure.in	(revision 45677)
+++ configure.in	(revision 45678)
@@ -1732,6 +1732,7 @@ AC_CHECK_TYPES([struct statfs], [], [], https://github.com/ruby/ruby/blob/trunk/configure.in#L1732
 @%:@ifdef HAVE_SYS_VFS_H
 @%:@ include <sys/vfs.h>
 @%:@endif])
+AS_IF([test "$ac_cv_type_struct_statfs" = yes], [
 AC_CHECK_MEMBERS([struct statfs.f_fstypename], [], [], [@%:@ifdef HAVE_SYS_PARAM_H
 @%:@ include <sys/param.h>
 @%:@endif
@@ -1741,6 +1742,16 @@ AC_CHECK_MEMBERS([struct statfs.f_fstype https://github.com/ruby/ruby/blob/trunk/configure.in#L1742
 @%:@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
 @%:@ include <time.h>
Index: file.c
===================================================================
--- file.c	(revision 45677)
+++ file.c	(revision 45678)
@@ -5540,12 +5540,16 @@ statfs_ffree(VALUE self) https://github.com/ruby/ruby/blob/trunk/file.c#L5540
 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
 }
 
 #ifdef HAVE_STRUCT_STATFS_F_FSTYPENAME

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]