diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index f4b17a4b6..897585d50 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -10,7 +10,17 @@ name: R-CMD-check jobs: R-CMD-check: - runs-on: ubuntu-latest + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macOS-latest, r: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: windows-latest, r: 'release'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes diff --git a/DESCRIPTION b/DESCRIPTION index ec443b779..dab24b8e6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: RcppParallel Type: Package Title: Parallel Programming Tools for 'Rcpp' -Version: 5.1.7-9000 +Version: 5.1.7-9001 Authors@R: c( person("JJ", "Allaire", role = c("aut"), email = "jj@rstudio.com"), person("Romain", "Francois", role = c("aut", "cph")), diff --git a/inst/include/RcppParallel.h b/inst/include/RcppParallel.h index f78a5db43..637c16d4b 100644 --- a/inst/include/RcppParallel.h +++ b/inst/include/RcppParallel.h @@ -69,4 +69,14 @@ inline void parallelReduce(std::size_t begin, } // end namespace RcppParallel +// TRUE and FALSE macros that may come with system headers on some systems +// But conflict with R.h (R_ext/Boolean.h) +// TRUE and FALSE macros should be undef in RcppParallel.h +#ifdef TRUE + #undef TRUE +#endif +#ifdef FALSE + #undef FALSE +#endif + #endif // __RCPP_PARALLEL__ diff --git a/inst/tests/cpp/truefalse_macros.cpp b/inst/tests/cpp/truefalse_macros.cpp new file mode 100644 index 000000000..412c88399 --- /dev/null +++ b/inst/tests/cpp/truefalse_macros.cpp @@ -0,0 +1,31 @@ +/** + * @title Test for TRUE and FALSE macros + * @author Travers Ching + * @license GPL (>= 2) + */ + +// TRUE and FALSE macros that may come with system headers on some systems +// But conflict with R.h (R_ext/Boolean.h) +// TRUE and FALSE macros should be undef in RcppParallel.h + +#include <Rcpp.h> +#include <RcppParallel.h> + +// [[Rcpp::depends(RcppParallel)]] + +#ifndef TRUE +static_assert(true, "Macro TRUE does not exist"); +#else +static_assert(false, "Macro TRUE exists"); +#endif + +#ifndef FALSE +static_assert(true, "Macro FALSE does not exist"); +#else +static_assert(false, "Macro FALSE exists"); +#endif + +// [[Rcpp::export]] +int hush_no_export_warning() { + return 1; +} \ No newline at end of file diff --git a/inst/tests/runit.truefalse_macros.R b/inst/tests/runit.truefalse_macros.R new file mode 100644 index 000000000..8e403e364 --- /dev/null +++ b/inst/tests/runit.truefalse_macros.R @@ -0,0 +1,6 @@ + +library(Rcpp) +library(RUnit) + +sourceCpp(system.file("tests/cpp/truefalse_macros.cpp", package = "RcppParallel")) +