Re: [Rd] defines in Rmath.h and R_NO_REMAP

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon, 13 Oct 2008 10:55:15 +0100 (BST)

If you read the 'Writing R Extensions' manual it only mentions R_NO_REMAP in conjuction with Rinternals.h and R_ext/Error.h.

So yes, it is intentional that it does not work for Rmath.h. If you would like it to, remember we often say 'patches will be considered'. But see the inline comment below.

On Sat, 11 Oct 2008, Daniel Sabanés Bové wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Hi,
>
> I'm programming with R 2.7.2 and had some trouble including
> Rmath.h for its random variates generation routines: Although
> I define R_NO_REMAP (which works fine for Rinternals.h stuff),
> Rmath.h defines "beta" as "Rf_beta" etc., so that my "beta" strings
> get redefined as well! Is this a feature?
>
> I found an old Rmath.h version from 2000,
> which seems to obey the R_NO_REMAP flag, but the present version
> only obeys the math library standalone flag and ignores R_NO_REMAP.
>
> As a bad workaround I defined some forwarding functions and
> included Rmath.h in a separate part of the code... but this is not
> very beautiful.

You could just #undef beta !

> Thanks,
> Daniel
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.9 (GNU/Linux)
> Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
>
> iEYEAREKAAYFAkjxAVsACgkQnhBrrSA4m1EMsQCdGIQ/UH+E8fRtPL5fOdhW2r3/
> n9cAn3sueVFTMHEY2/a5oAHH+lapA5bF
> =wmwk
> -----END PGP SIGNATURE-----
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Received on Mon 13 Oct 2008 - 09:57:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 13 Oct 2008 - 19:30:43 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive