From edd at debian.org  Sun Jan  1 19:29:44 2017
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sun, 1 Jan 2017 12:29:44 -0600
Subject: [Rd] Definition of uintptr_t in Rinterface.h
In-Reply-To: <ebab4eb6-e739-badb-1af1-ffc77bbb5847@stats.ox.ac.uk>
References: <CA+JCgN0pwwmtPZ+p4Yf2fi1uXb2r-0H1jD+hOj1iWi58EiO-_A@mail.gmail.com>
	<3ECD3048-DC04-467B-BD33-787A4E70FE67@r-project.org>
	<ebab4eb6-e739-badb-1af1-ffc77bbb5847@stats.ox.ac.uk>
Message-ID: <22633.19096.701756.331496@max.nulle.part>


On 1 January 2017 at 13:28, Prof Brian Ripley wrote:
| On 29/12/2016 15:55, Simon Urbanek wrote:
| > The problem is elsewhere - Rinterface.h guards the ultima-ratio fallback with HAVE_UINTPTR_T but that config flag is not exported in Rconfig.h. Should be now fixed in R-devel - please check if that works for you.
| 
| Rconfig.h would be appropriate if Rinterface.h is being included from C 
| code using the same compiler as used for R.  But as Rinterface.h is 
| intended for use by alternative front ends there is no guarantee that 
| they use the same compiler (and some use C++).
| 
| This was documented in the manual:
| 
| 'Note that uintptr_t is a C99 type for which a substitute is defined in 
| R, so your code needs to define HAVE_UINTPTR_T appropriately.'
| 
| AFAICS if you comply, there will not be a conflict.
| 
| Also note that is only an issue if CSTACK_DEFNS is defined, not the 
| default and not mentioned here.

Relatedly: Any good way about "using the same compiler as used for R"?

I write one package exposing some internal R API for wider use
in a package (RApiSerialize, used eg by RcppRedis) and like that scheme. I
might do the same for date/time/timezone logic but this hinges on these
settings (among other things).

Any good ideas how to go about this?  So far I mostly use 'don't ask don't
tell' and rely on the compiler to actually fail when something doesn't hold.
We can probably do better...

Best wishes to all useRs and devRs in 2017.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] Definition of uintptr_t in Rinterface.h
Dirk Eddelbuettel