From fadd0160d0a4ac46af821c118f068d3fd806b990 Mon Sep 17 00:00:00 2001 From: odaira Date: Sun, 3 May 2015 13:54:54 +0000 Subject: [PATCH] * ext/-test-/file/fs.c: need to include sys/statvfs.h to use statvfs(). * ext/-test-/file/extconf.rb: check the existence of sys/statvfs.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ ext/-test-/file/extconf.rb | 2 +- ext/-test-/file/fs.c | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e409d8176b..d348fe2197 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sun May 3 22:40:06 2015 Rei Odaira + + * ext/-test-/file/fs.c: need to include sys/statvfs.h + to use statvfs(). + + * ext/-test-/file/extconf.rb: check the existence of + sys/statvfs.h + Sun May 3 21:59:48 2015 SHIBATA Hiroshi * lib/yaml.rb: fix typo. [ci skip][fix GH-890] diff --git a/ext/-test-/file/extconf.rb b/ext/-test-/file/extconf.rb index be4a2fbdeb..87a2f4a205 100644 --- a/ext/-test-/file/extconf.rb +++ b/ext/-test-/file/extconf.rb @@ -6,7 +6,7 @@ if have_type("struct statfs", headers) have_struct_member("struct statfs", "f_type", headers) end -headers = %w[sys/statvfs.h] +headers = %w[sys/statvfs.h].select {|h| have_header(h)} if have_type("struct statvfs", headers) have_struct_member("struct statvfs", "f_fstypename", headers) have_struct_member("struct statvfs", "f_basetype", headers) diff --git a/ext/-test-/file/fs.c b/ext/-test-/file/fs.c index f0be84ad3b..d3fa5350e5 100644 --- a/ext/-test-/file/fs.c +++ b/ext/-test-/file/fs.c @@ -10,6 +10,9 @@ #ifdef HAVE_SYS_VFS_H #include #endif +#ifdef HAVE_SYS_STATVFS_H +#include +#endif #if defined HAVE_STRUCT_STATFS_F_FSTYPENAME typedef struct statfs statfs_t;