Skip to content
Browse files

Merge branch 'lonelyelk_test'

  • Loading branch information...
2 parents 7533bb9 + 8e9fa59 commit 5ca501f92befbd14f08eed6a5c3fb0b47ccfff44 Hector G. Parra committed Oct 14, 2009
Showing with 8 additions and 7 deletions.
  1. +1 −1 VERSION
  2. +1 −0 extconf.rb
  3. +5 −5 src/posix_serialport_impl.c
  4. +1 −1 src/serialport.h
View
2 VERSION
@@ -1 +1 @@
-0.7.4
+0.8.0
View
1 extconf.rb
@@ -5,6 +5,7 @@
os = /-([a-z]+)/.match(RUBY_PLATFORM)[1]
puts(os)
$CFLAGS += " -DOS_#{os.upcase}"
+$CFLAGS += " -DRUBY_19" if RUBY_VERSION =~ /^1\.9/
if !(os == 'mswin' or os == 'bccwin' or os == 'mingw')
exit(1) if not have_header("termios.h") or not have_header("unistd.h")
View
10 src/posix_serialport_impl.c
@@ -43,13 +43,13 @@ static char sIoctl[] = "ioctl";
int get_fd_helper(obj)
VALUE obj;
{
-#if RUBY_VERSION >= '1.9.0'
+#ifdef RUBY_19
rb_io_t *fptr;
#else
OpenFile *fptr;
#endif
GetOpenFile(obj, fptr);
-#if RUBY_VERSION >= '1.9.0'
+#ifdef RUBY_19
return (fptr->fd);
#else
return (fileno(fptr->f));
@@ -59,7 +59,7 @@ int get_fd_helper(obj)
VALUE sp_create_impl(class, _port)
VALUE class, _port;
{
-#if RUBY_VERSION >= '1.9.0'
+#ifdef RUBY_19
rb_io_t *fp;
#else
OpenFile *fp;
@@ -106,7 +106,7 @@ VALUE sp_create_impl(class, _port)
case T_STRING:
Check_SafeStr(_port);
-#if RUBY_VERSION >= '1.9.0'
+#ifdef RUBY_19
port = RSTRING_PTR(_port);
#else
port = RSTRING(_port)->ptr;
@@ -151,7 +151,7 @@ VALUE sp_create_impl(class, _port)
rb_sys_fail(sTcsetattr);
}
-#if RUBY_VERSION >= '1.9.0'
+#ifdef RUBY_19
fp->fd = fd;
#else
fp->f = rb_fdopen(fd, "r+");
View
2 src/serialport.h
@@ -24,7 +24,7 @@
#include <ruby.h> /* ruby inclusion */
-#if RUBY_VERSION >= '1.9.0'
+#ifdef RUBY_19
#include <ruby/io.h>
#else
#include <rubyio.h>

0 comments on commit 5ca501f

Please sign in to comment.
Something went wrong with that request. Please try again.