From: nobuyoshi nakada Date: 2005-05-27T16:47:58+09:00 Subject: Re: ruby-termios: Patch to make it work under both 1.8 and 1.9 Hi, At Fri, 27 May 2005 15:56:27 +0900, Lloyd Zusman wrote in [ruby-talk:143778]: > I recently had problems getting ruby-termios to compile properly under > ruby 1.9. It turns out that "rubyio.h" has changed between these two > ruby versions, and therefore, I offer the following patch, which should > enable ruby-termios to compile and run under all 1.8 and 1.9 ruby > versions. > +#include "version.h" > + > +#if RUBY_VERSION_CODE >= 190 > +# define FPTR_FILE fptr->stdio_file > +#else > +# define FPTR_FILE fptr->f > +#endif stdio_file isn't non-NULL always. Use rb_io_stdio_file() instead. #ifdef GetReadFile #define FPTR_FILE GetReadFile(fptr) #else #define FPTR_FILE rb_io_stdio_file(fptr) #endif -- Nobu Nakada