[macruby-changes] [4835] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Wed Oct 27 14:36:18 PDT 2010
Revision: 4835
http://trac.macosforge.org/projects/ruby/changeset/4835
Author: lsansonetti at apple.com
Date: 2010-10-27 14:36:17 -0700 (Wed, 27 Oct 2010)
Log Message:
-----------
revert r4834 and try to fix the problem differently (including CoreFoundation.h in public headers is not a good idea)
Revision Links:
--------------
http://trac.macosforge.org/projects/ruby/changeset/4834
Modified Paths:
--------------
MacRuby/trunk/include/ruby/io.h
MacRuby/trunk/io.c
Modified: MacRuby/trunk/include/ruby/io.h
===================================================================
--- MacRuby/trunk/include/ruby/io.h 2010-10-27 03:35:27 UTC (rev 4834)
+++ MacRuby/trunk/include/ruby/io.h 2010-10-27 21:36:17 UTC (rev 4835)
@@ -23,7 +23,6 @@
#include <errno.h>
#include <spawn.h>
#include <fcntl.h>
-#include <CoreFoundation/CoreFoundation.h>
#include "ruby/encoding.h"
typedef struct rb_io_t {
@@ -36,7 +35,11 @@
int lineno;
int mode;
+#if defined(__COREFOUNDATION__)
CFMutableDataRef buf;
+#else
+ void *buf;
+#endif
unsigned long buf_offset;
} rb_io_t;
@@ -68,10 +71,11 @@
VALUE rb_io_taint_check(VALUE);
NORETURN(void rb_eof_error(void));
-long rb_io_primitive_read(struct rb_io_t *io_struct, UInt8 *buffer, long len);
+long rb_io_primitive_read(struct rb_io_t *io_struct, char *buffer, long len);
-bool rb_io_wait_readable(int fd);
-bool rb_io_wait_writable(int fd);
+int rb_io_wait_readable(int fd);
+int rb_io_wait_writable(int fd);
+int rb_io_read_pending(rb_io_t *io_struct);
static inline void
rb_io_check_initialized(rb_io_t *fptr)
@@ -90,12 +94,6 @@
}
}
-static inline bool
-rb_io_read_pending(rb_io_t *io_struct)
-{
- return io_struct->buf != NULL && CFDataGetLength(io_struct->buf) > 0;
-}
-
static inline void
rb_io_assert_writable(rb_io_t *io_struct)
{
Modified: MacRuby/trunk/io.c
===================================================================
--- MacRuby/trunk/io.c 2010-10-27 03:35:27 UTC (rev 4834)
+++ MacRuby/trunk/io.c 2010-10-27 21:36:17 UTC (rev 4835)
@@ -917,19 +917,31 @@
return false;
}
-bool
+// Note: not bool since it's exported in a public header which does not
+// include stdbool.
+int
rb_io_wait_readable(int fd)
{
return __rb_io_wait_readable(fd);
}
-bool
+// Note: not bool since it's exported in a public header which does not
+// include stdbool.
+int
rb_io_wait_writable(int fd)
{
// TODO
return false;
}
+// Note: not bool since it's exported in a public header which does not
+// include stdbool.
+int
+rb_io_read_pending(rb_io_t *io_struct)
+{
+ return io_struct->buf != NULL && CFDataGetLength(io_struct->buf) > 0;
+}
+
static inline long
read_internal(int fd, UInt8 *buffer, long len)
{
@@ -1041,9 +1053,9 @@
}
long
-rb_io_primitive_read(rb_io_t *io_struct, UInt8 *buffer, long len)
+rb_io_primitive_read(rb_io_t *io_struct, char *buffer, long len)
{
- return rb_io_read_internal(io_struct, buffer, len);
+ return rb_io_read_internal(io_struct, (UInt8 *)buffer, len);
}
/*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101027/72baad93/attachment.html>
More information about the macruby-changes
mailing list