From f1b65f2fad38293bfa29be2ddda7bbcbc629e878 Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Thu, 11 Feb 2016 15:03:09 -0800 Subject: [PATCH 1/2] check _WIN32 rather than WIN32 For new Rtools compatibility. --- src/RInside.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RInside.cpp b/src/RInside.cpp index 7202ce9..eae9a7d 100644 --- a/src/RInside.cpp +++ b/src/RInside.cpp @@ -22,7 +22,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #define R_INTERFACE_PTRS #include #endif From 341bfed4d00882dd6ede9440f8dbf791b462f8bb Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Thu, 11 Feb 2016 15:04:30 -0800 Subject: [PATCH 2/2] more _WIN32 changes --- src/RInside.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/RInside.cpp b/src/RInside.cpp index eae9a7d..0349ffd 100644 --- a/src/RInside.cpp +++ b/src/RInside.cpp @@ -31,7 +31,7 @@ RInside* RInside::instance_m = 0 ; const char *programName = "RInside"; -#ifdef WIN32 +#ifdef _WIN32 // on Windows, we need to provide setenv which is in the file setenv.c here #include "setenv/setenv.c" extern int optind; @@ -58,7 +58,7 @@ RInside::RInside(): global_env_m(NULL) initialize(0, 0, false, false, false); } -#ifdef WIN32 +#ifdef _WIN32 static int myReadConsole(const char *prompt, char *buf, int len, int addtohistory) { fputs(prompt, stdout); fflush(stdout); @@ -117,7 +117,7 @@ void RInside::initialize(const int argc, const char* const argv[], const bool lo // generated from Makevars{.win} #include "RInsideEnvVars.h" - #ifdef WIN32 + #ifdef _WIN32 // we need a special case for Windows where users may deploy an RInside binary from CRAN // which will have R_HOME set at compile time to CRAN's value -- so let's try to correct // this here: a) allow user's setting of R_HOME and b) use R's get_R_HOME() function @@ -139,7 +139,7 @@ void RInside::initialize(const int argc, const char* const argv[], const bool lo } } - #ifndef WIN32 + #ifndef _WIN32 R_SignalHandlers = 0; // Don't let R set up its own signal handlers #endif @@ -150,7 +150,7 @@ void RInside::initialize(const int argc, const char* const argv[], const bool lo int R_argc = sizeof(R_argv) / sizeof(R_argv[0]); Rf_initEmbeddedR(R_argc, (char**)R_argv); - #ifndef WIN32 + #ifndef _WIN32 R_CStackLimit = -1; // Don't do any stack checking, see R Exts, '8.1.5 Threading issues' #endif @@ -159,7 +159,7 @@ void RInside::initialize(const int argc, const char* const argv[], const bool lo structRstart Rst; R_DefParams(&Rst); Rst.R_Interactive = (Rboolean) interactive_m; // sets interactive() to eval to false - #ifdef WIN32 + #ifdef _WIN32 Rst.rhome = getenv("R_HOME"); // which is set above as part of R_VARS Rst.home = getRUser(); Rst.CharacterMode = LinkDLL; @@ -472,7 +472,7 @@ void RInside_Busy( int which ){ void RInside::set_callbacks(Callbacks* callbacks_){ callbacks = callbacks_ ; -#ifdef WIN32 +#ifdef _WIN32 // do something to tell user that he doesn't get this #else