From 286a45f1ffbbd6b816fe9802988dc391285558ba Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Mon, 30 Sep 2019 21:04:28 -0700 Subject: [PATCH] disable inclusion of modules code with RCPP_NO_MODULES --- ChangeLog | 6 ++++++ inst/include/Rcpp.h | 2 ++ inst/include/Rcpp/api/meat/is.h | 4 ++++ inst/include/Rcpp/api/meat/meat.h | 2 ++ 4 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 80c014450..55707b064 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-09-30 Kevin Ushey + + * inst/include/Rcpp.h: add RCPP_NO_MODULES + * inst/include/Rcpp/api/meat/is.h: Idem + * inst/include/Rcpp/api/meat/meat.h: Idem + 2019-09-28 Dirk Eddelbuettel * README.md: Add a stackoverflow tag to indicate where to ask questions, diff --git a/inst/include/Rcpp.h b/inst/include/Rcpp.h index 0d2b9dbc0..88f2af6cb 100644 --- a/inst/include/Rcpp.h +++ b/inst/include/Rcpp.h @@ -63,8 +63,10 @@ #include +#ifndef RCPP_NO_MODULES #include #include +#endif #include diff --git a/inst/include/Rcpp/api/meat/is.h b/inst/include/Rcpp/api/meat/is.h index 2cc995026..93f6f9563 100644 --- a/inst/include/Rcpp/api/meat/is.h +++ b/inst/include/Rcpp/api/meat/is.h @@ -148,6 +148,8 @@ namespace Rcpp { return TYPEOF(x) == REALSXP && Rf_inherits(x, "POSIXt"); } +#ifndef RCPP_NO_MODULES + inline bool is_module_object_internal(SEXP obj, const char* clazz){ Environment env(obj); SEXP sexp = env.get(".cppclass"); @@ -161,6 +163,8 @@ namespace Rcpp { return is_module_object_internal(x, typeid(CLASS).name()); } +#endif + } // namespace internal } // namespace Rcpp diff --git a/inst/include/Rcpp/api/meat/meat.h b/inst/include/Rcpp/api/meat/meat.h index 76150caeb..13e67fb1f 100644 --- a/inst/include/Rcpp/api/meat/meat.h +++ b/inst/include/Rcpp/api/meat/meat.h @@ -42,6 +42,8 @@ #include #include +#ifndef RCPP_NO_MODULES #include +#endif #endif