Skip to content

Commit

Permalink
fix version checks
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Jul 9, 2024
1 parent edcf98f commit df61715
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions inst/include/Rcpp/r/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
#ifndef RCPP_R_COMPAT_H
#define RCPP_R_COMPAT_H

#if defined(STRING_PTR_RO)
#include <Rversion.h>

#if R_VERSION >= R_Version(4, 4, 0)
# define RCPP_STRING_PTR STRING_PTR_RO
#else
# define RCPP_STRING_PTR STRING_PTR
#endif

#if defined(VECTOR_PTR_RO)
#if R_VERSION >= R_Version(4, 4, 0)
# define RCPP_VECTOR_PTR VECTOR_PTR_RO
#else
# define RCPP_VECTOR_PTR VECTOR_PTR
Expand Down
2 changes: 1 addition & 1 deletion src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace Rcpp {
case BCODESXP: return "BCODESXP";
case EXTPTRSXP: return "EXTPTRSXP";
case WEAKREFSXP: return "WEAKREFSXP";
#if R_Version >= R_Version(4,4,0) // replaces S4SXP in R 4.4.0
#if R_VERSION >= R_Version(4,4,0) // replaces S4SXP in R 4.4.0
case OBJSXP: return Rf_isS4(x) ? "S4SXP" : "OBJSXP"; // cf src/main/inspect.c
#else
case S4SXP: return "S4SXP";
Expand Down

0 comments on commit df61715

Please sign in to comment.