summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--io.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index dcc80e6618..5c637fedc5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jan 14 05:37:06 2006 Tanaka Akira <akr@m17n.org>
+
+ * io.c (READ_DATA_PENDING, READ_DATA_PENDING_COUNT): defined
+ for DragonFly BSD 1.4.0.
+
Sat Jan 14 03:43:24 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=
diff --git a/io.c b/io.c
index 4973efbf90..8e63af2d10 100644
--- a/io.c
+++ b/io.c
@@ -169,6 +169,10 @@ typedef struct _FILE64 {
# define READ_DATA_PENDING_COUNT(fp) ((unsigned int)(*(fp))->_cnt)
# define READ_DATA_PENDING(fp) (((unsigned int)(*(fp))->_cnt) > 0)
# define READ_DATA_BUFFERED(fp) 0
+#elif defined(__DragonFly__)
+/* FILE is an incomplete struct type since DragonFly BSD 1.4.0 */
+# define READ_DATA_PENDING(fp) (((struct __FILE_public *)(fp))->_r > 0)
+# define READ_DATA_PENDING_COUNT(fp) (((struct __FILE_public *)(fp))->_r)
#else
/* requires systems own version of the ReadDataPending() */
extern int ReadDataPending();