On Wed, Oct 1, 2008 at 11:07 AM, Bill Kelly <billk / cts.com> wrote: > > From: "Johan Holmberg" <johan556 / gmail.com> >> >> On Tue, Sep 30, 2008 at 9:27 PM, Nobuyoshi Nakada <nobu / ruby-lang.org> >> wrote: [...] >> Is there any chance that it could be backported to 1.8? >> I would like to stay with 1.8 until 1.9 is *the* Ruby used by "everybody". >> >> Your answer in another mail in this thread seem to imply that it is a >> rather easy fix (#ifdef RUBY_EXPORT). Or is it more complicated? > > Note, it's quite possible to use 1.8 with C++, even if it's > not officially supported. > > We have been embedding ruby 1.8.4 into a C++ app for quite > a while. The app builds on both Windows and OS X. > I also have a C++ application running on OS X, Linux and Windows. In the Windows-version I have tried to tackle the problems on a case-by-case basis until now. Currently I have code like below in some of my files: -------------------------------- #include <ruby.h> #include <st.h> #ifdef _WIN32 // remove stupid ruby defintion #undef write #undef read #endif -------------------------------- We seem to have encountered similar problems, for example: where to place "ruby.h", how to get VALUE defined. Until now I have tried to avoid having the Ruby-problems affect how I organize my header files. But perhaps the best way to cope with 1.8 is to place "ruby.h" as locally as possible as you (and Matz earlier) suggested. > > Hope this helps, > Bill > Yes, it is interesting to hear how others handle these kinds of problems. Thanks, /Johan Holmberg