summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--io.c8
-rw-r--r--test/sdbm/test_sdbm.rb14
3 files changed, 15 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 85904d774b..63378aebf9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Jul 20 19:20:37 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (S_ISREG): need to define S_ISREG before it is used first.
+
Wed Jul 20 18:40:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* io.c (wsplit_p): patch for the environment where
diff --git a/io.c b/io.c
index 784f7c60a1..43bd9c5d4b 100644
--- a/io.c
+++ b/io.c
@@ -388,6 +388,10 @@ rb_io_wait_writable(f)
}
}
+#ifndef S_ISREG
+# define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
+#endif
+
static int
wsplit_p(OpenFile *fptr)
{
@@ -1061,10 +1065,6 @@ rb_io_fread(ptr, len, f)
return io_fread(ptr, len, &of);
}
-#ifndef S_ISREG
-# define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
-#endif
-
#define SMALLBUF 100
static long
diff --git a/test/sdbm/test_sdbm.rb b/test/sdbm/test_sdbm.rb
index abaadbaf71..17b3d3c4e7 100644
--- a/test/sdbm/test_sdbm.rb
+++ b/test/sdbm/test_sdbm.rb
@@ -31,14 +31,14 @@ class TestSDBM < Test::Unit::TestCase
end
end
- def have_fork?
- begin
- fork{}
- true
- rescue NotImplementedError
- false
- end
+ def have_fork?
+ begin
+ fork{}
+ true
+ rescue NotImplementedError
+ false
end
+ end
def test_version
assert(! SDBM.const_defined?(:VERSION))