<div dir="ltr">Hi John,<div><br></div><div> it's nice to see that the <span style="font-family:arial,sans-serif;font-size:13px">#undefs WIN32 didn't come out of nowhere!</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Thanks,</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Matteo</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 29, 2014 at 4:45 PM, John Buonagurio <span dir="ltr"><<a href="mailto:jbuonagurio@exponent.com" target="_blank">jbuonagurio@exponent.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dirk and Matteo,<br>
<br>
This is a MinGW issue, which as far as I can tell is undocumented.<br>
<br>
When CXX_STD=CXX11 is added to Makevars.win, R ultimately translates this to "-std=c++0x" in the g++ command (via CXX1XSTD in Makeconf). For some reason, MinGW then #undefs WIN32. This doesn't happen using use "-std=gnu++0x"<br>

<br>
You can work around this by checking for _WIN32 instead of WIN32, or just add another define:<br>
<br>
#ifdef _WIN32<br>
#define WIN32<br>
#endif<br>
<br>
But, as you saw even with this fixed, Armadillo still has issues with the Rtools GCC...<br>
<br>
Best,<br>
John<br>
<div class="HOEnZb"><div class="h5"><br>
| -----Original Message-----<br>
| From: <a href="mailto:rcpp-devel-bounces@lists.r-forge.r-project.org">rcpp-devel-bounces@lists.r-forge.r-project.org</a> [mailto:<a href="mailto:rcpp-devel-">rcpp-devel-</a><br>
| <a href="mailto:bounces@lists.r-forge.r-project.org">bounces@lists.r-forge.r-project.org</a>] On Behalf Of Dirk Eddelbuettel<br>
| Sent: Thursday, May 29, 2014 9:32 AM<br>
| To: Matteo Fasiolo<br>
| Cc: <a href="mailto:rcpp-devel@lists.r-forge.r-project.org">rcpp-devel@lists.r-forge.r-project.org</a><br>
| Subject: Re: [Rcpp-devel] C++11 in Windows R package<br>
|<br>
|<br>
| On 29 May 2014 at 14:27, Matteo Fasiolo wrote:<br>
| |  hopefully this is what you meant: I have searched the sources of<br>
| | RcppArmadillo, Rcpp and R-3.1.0 for the string "#undef WIN32", but I<br>
| | didn't find anything.<br>
| |<br>
| | I used for example: grep -rnw 'RcppArmadillo' -e '#undef WIN32'<br>
|<br>
| I was just on the commuter train, did the same and didn't see it either.<br>
|<br>
| But here is another idea: add    -DWIN32   in src/Makevars.win.  Maybe that<br>
| definition "survives" and you end up in the right branch.<br>
|<br>
| Dirk<br>
|<br>
| --<br>
| Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</div></div><div class="HOEnZb"><div class="h5">| _______________________________________________<br>
| Rcpp-devel mailing list<br>
| <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
| <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</div></div></blockquote></div><br></div>