From Martin Maechler <maechler@stat.math.ethz.ch>  Fri Jan 31 12:08:03 2003
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Fri Jan 31 12:08:03 2003
Subject: [Rd] Embedding R in C++
In-Reply-To: <Pine.LNX.4.44.0301310913320.15799-100000@gannet.stats>
References: <101F2E8E-34F5-11D7-AD1D-00039391E298@zedshaw.com>
 <Pine.LNX.4.44.0301310913320.15799-100000@gannet.stats>
Message-ID: <15930.22607.388452.133011@gargle.gargle.HOWL>

>>>>> "BDR" == Brian D Ripley <ripley@stats.ox.ac.uk>
>>>>>     on Fri, 31 Jan 2003 10:36:12 +0000 (GMT) writes:

    BDR> It's a problem with e.g. the Matrix package, and has
    BDR> been with others.  Careful use of #undef is needed; see
    BDR> the code there.

    BDR> Another problem is mixing with Windows headers, which
    BDR> g++ has now in its wisdom decided to include from some
    BDR> C++ headers.  #under ERROR is sometimes needed, for
    BDR> example, as well as length, append and Free.

    BDR> It's worth noting that almost all these problems have
    BDR> emerged with libg++-v3 and/or mingw-runtime-2.x.  So
    BDR> another version might be

    BDR>      'Other libraries like to define things which R has
    BDR> already defined.'

    BDR> which is intended to help explain why projects such as
    BDR> R cannot suddenly jump to the tune of g++ or glibc or
    BDR> mingw ... as our API has customers too.

    BDR> In the case of PI, there is a standard define, M_PI,
    BDR> but according to R-exts this is included in R's headers
    BDR> for compatibility with S (and so is ERROR).  I do
    BDR> wonder if we should not have a define that removes
    BDR> these compatibility defines.  What might be a good
    BDR> name: NO_S_DEFINES?  STRICT_R_HEADERS?

I'd prefer the 2nd (but not strongly)

    BDR> In the cases of length and append we ought to bite the
    BDR> bullet and stop re-defining them.

Yes, I tend to agree on all points.
Martin.

    <...Zed Shaw's message in thread...>



[Rd] Embedding R in C++
Martin Maechler