Skip to content

Commit

Permalink
MINOR: [R] switch on R_VERSION (#43504)
Browse files Browse the repository at this point in the history
A follow on to #43243 `#ifdef function declaration` does not work, instead we must use the `#if (R_VERSION >= R_Version(4, 2, 0))` pattern to only include code for specific versions.

Lead-authored-by: Jonathan Keane <[email protected]>
Co-authored-by: Neal Richardson <[email protected]>
Signed-off-by: Jonathan Keane <[email protected]>
  • Loading branch information
jonkeane and nealrichardson committed Aug 5, 2024
1 parent a7d24cd commit fedffbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion r/src/arrow_cpp11.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ SEXP to_r6(const std::shared_ptr<T>& ptr, const char* r6_class_name) {

// R_existsVarInFrame doesn't exist before R 4.2, so we need to fall back to
// Rf_findVarInFrame3 if it is not defined.
#ifdef R_existsVarInFrame
#if R_VERSION >= R_Version(4, 2, 0)
if (!R_existsVarInFrame(arrow::r::ns::arrow, r6_class)) {
cpp11::stop("No arrow R6 class named '%s'", r6_class_name);
}
Expand Down

0 comments on commit fedffbd

Please sign in to comment.