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

ruby-changes:33586

From: naruse <ko1@a...>
Date: Tue, 22 Apr 2014 21:57:45 +0900 (JST)
Subject: [ruby-changes:33586] naruse:r45667 (trunk): define File::Statfs only if HAVE_STRUCT_STATFS

naruse	2014-04-22 21:57:38 +0900 (Tue, 22 Apr 2014)

  New Revision: 45667

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

  Log:
    define File::Statfs only if HAVE_STRUCT_STATFS

  Modified files:
    trunk/file.c
Index: file.c
===================================================================
--- file.c	(revision 45666)
+++ file.c	(revision 45667)
@@ -69,7 +69,9 @@ int flock(int, int); https://github.com/ruby/ruby/blob/trunk/file.c#L69
 #ifdef HAVE_SYS_VFS_H
 #include <sys/vfs.h>
 #endif
-VALUE rb_statfs_new(const struct statfs *st);
+#ifdef HAVE_STRUCT_STATFS
+static VALUE rb_statfs_new(const struct statfs *st);
+#endif
 
 #if defined(__native_client__) && defined(NACL_NEWLIB)
 # include "nacl/utime.h"
@@ -1095,6 +1097,7 @@ rb_file_lstat(VALUE obj) https://github.com/ruby/ruby/blob/trunk/file.c#L1097
 #endif
 }
 
+#ifdef HAVE_STRUCT_STATFS
 /*
  *  call-seq:
  *     ios.statfs    -> statfs
@@ -1122,6 +1125,7 @@ rb_io_statfs(VALUE obj) https://github.com/ruby/ruby/blob/trunk/file.c#L1125
     }
     return rb_statfs_new(&st);
 }
+#endif
 
 static int
 rb_group_member(GETGROUPS_T gid)
@@ -5300,6 +5304,7 @@ rb_stat_sticky(VALUE obj) https://github.com/ruby/ruby/blob/trunk/file.c#L5304
     return Qfalse;
 }
 
+#ifdef HAVE_STRUCT_STATFS
 /* File::Statfs */
 
 static size_t
@@ -5326,7 +5331,7 @@ statfs_new_0(VALUE klass, const struct s https://github.com/ruby/ruby/blob/trunk/file.c#L5331
     return TypedData_Wrap_Struct(klass, &statfs_data_type, nst);
 }
 
-VALUE
+static VALUE
 rb_statfs_new(const struct statfs *st)
 {
     return statfs_new_0(rb_cStatfs, st);
@@ -5547,6 +5552,7 @@ statfs_fstypename(VALUE self) https://github.com/ruby/ruby/blob/trunk/file.c#L5552
 #else
 #define statfs_fstypename rb_f_notimplement
 #endif
+#endif
 
 VALUE rb_mFConst;
 
@@ -6132,6 +6138,7 @@ Init_File(void) https://github.com/ruby/ruby/blob/trunk/file.c#L6138
     rb_define_method(rb_cStat, "setgid?",  rb_stat_sgid, 0);
     rb_define_method(rb_cStat, "sticky?",  rb_stat_sticky, 0);
 
+#ifdef HAVE_STRUCT_STATFS
     rb_cStatfs = rb_define_class_under(rb_cFile, "Statfs", rb_cObject);
     rb_define_alloc_func(rb_cStatfs,  rb_statfs_s_alloc);
     rb_define_method(rb_cStatfs, "initialize", rb_statfs_init, 1);
@@ -6145,4 +6152,5 @@ Init_File(void) https://github.com/ruby/ruby/blob/trunk/file.c#L6152
     rb_define_method(rb_cStatfs, "ffree", statfs_ffree, 0);
     rb_define_method(rb_cStatfs, "fsid", statfs_fsid, 0);
     rb_define_method(rb_cStatfs, "fstypename", statfs_fstypename, 0);
+#endif
 }

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

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