From d29036df2b065a71930132bdeb43215b0a826c0f Mon Sep 17 00:00:00 2001 From: Marvin Wright Date: Thu, 15 Jan 2026 15:56:38 +0100 Subject: [PATCH 1/3] temporarily enforce cpp20 for testing CRAN issue --- src/Makevars | 3 ++- src/Makevars.win | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Makevars b/src/Makevars index a77f2396..016e9d51 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,2 +1,3 @@ PKG_CPPFLAGS = -DR_BUILD - +CXX_STD = CXX20 +PKG_CXXFLAGS = -std=c++20 diff --git a/src/Makevars.win b/src/Makevars.win index a6af4dd1..6532fc1c 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,2 +1,3 @@ PKG_CPPFLAGS = -DR_BUILD -DWIN_R_BUILD - +CXX_STD = CXX20 +PKG_CXXFLAGS = -std=c++20 From dfd392803d8098b4a5aa921b15abd6c2a1cf2743 Mon Sep 17 00:00:00 2001 From: Marvin Wright Date: Thu, 15 Jan 2026 16:03:12 +0100 Subject: [PATCH 2/3] fix cpp20 compilation --- src/utility.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utility.h b/src/utility.h index 7d9a57cd..eb1aa7f4 100644 --- a/src/utility.h +++ b/src/utility.h @@ -12,6 +12,10 @@ #ifndef UTILITY_H_ #define UTILITY_H_ +#ifdef R_BUILD +#include +#endif + #include #include #include @@ -25,10 +29,6 @@ #include #include -#ifdef R_BUILD -#include -#endif - #include "globals.h" #include "Data.h" From 57ec65149577185a44ffa29d0484c0c79aec34e4 Mon Sep 17 00:00:00 2001 From: Marvin Wright Date: Thu, 15 Jan 2026 16:03:35 +0100 Subject: [PATCH 3/3] new version for cpp20 fix --- DESCRIPTION | 6 +++--- NEWS.md | 3 +++ cpp_version/src/version.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 64acc597..1809564b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: ranger Type: Package Title: A Fast Implementation of Random Forests -Version: 0.17.1 -Date: 2025-06-04 +Version: 0.17.2 +Date: 2026-01-15 Authors@R: c( person("Marvin N.", "Wright", email = "cran@wrig.de", role = c("aut", "cre")), person("Stefan", "Wager", role = "ctb"), @@ -21,7 +21,7 @@ Suggests: survival, testthat Encoding: UTF-8 -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 URL: https://imbs-hl.github.io/ranger/, https://github.com/imbs-hl/ranger BugReports: https://github.com/imbs-hl/ranger/issues diff --git a/NEWS.md b/NEWS.md index 0f2f6cc1..99581931 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,7 @@ +# ranger 0.17.2 +* Fix compilation with C++20 + # ranger 0.17.1 * Fix bug where missing value handling lead to negative impurity importance values * Slightly change the missing value algorithm (see docs) diff --git a/cpp_version/src/version.h b/cpp_version/src/version.h index 7e2f9192..eedd6caf 100644 --- a/cpp_version/src/version.h +++ b/cpp_version/src/version.h @@ -1,3 +1,3 @@ #ifndef RANGER_VERSION -#define RANGER_VERSION "0.17.1" +#define RANGER_VERSION "0.17.2" #endif