Skip to content

Commit

Permalink
Support OBJSXP coming in R 4.4.0 (closes #1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Dec 24, 2023
1 parent 4a8d30f commit 9fe7082
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-12-21 Dirk Eddelbuettel <[email protected]>

* src/api.cpp (type2name): Recognise OBJSXP added in R 4.4.0

2023-11-28 Dirk Eddelbuettel <[email protected]>

* inst/tinytest/testRcppInterfaceExporter/R/RcppExports.R: Regenerated
Expand Down
47 changes: 25 additions & 22 deletions src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// api.cpp: Rcpp R/C++ interface class library -- Rcpp api
//
// Copyright (C) 2012 - 2020 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2021 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
// Copyright (C) 2021 - 2023 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
//
// This file is part of Rcpp.
//
Expand Down Expand Up @@ -89,30 +89,33 @@ namespace Rcpp {
// [[Rcpp::register]]
const char * type2name(SEXP x) { // #nocov start
switch (TYPEOF(x)) {
case NILSXP: return "NILSXP";
case SYMSXP: return "SYMSXP";
case RAWSXP: return "RAWSXP";
case LISTSXP: return "LISTSXP";
case CLOSXP: return "CLOSXP";
case ENVSXP: return "ENVSXP";
case PROMSXP: return "PROMSXP";
case LANGSXP: return "LANGSXP";
case NILSXP: return "NILSXP";
case SYMSXP: return "SYMSXP";
case RAWSXP: return "RAWSXP";
case LISTSXP: return "LISTSXP";
case CLOSXP: return "CLOSXP";
case ENVSXP: return "ENVSXP";
case PROMSXP: return "PROMSXP";
case LANGSXP: return "LANGSXP";
case SPECIALSXP: return "SPECIALSXP";
case BUILTINSXP: return "BUILTINSXP";
case CHARSXP: return "CHARSXP";
case LGLSXP: return "LGLSXP";
case INTSXP: return "INTSXP";
case REALSXP: return "REALSXP";
case CPLXSXP: return "CPLXSXP";
case STRSXP: return "STRSXP";
case DOTSXP: return "DOTSXP";
case ANYSXP: return "ANYSXP";
case VECSXP: return "VECSXP";
case EXPRSXP: return "EXPRSXP";
case BCODESXP: return "BCODESXP";
case EXTPTRSXP: return "EXTPTRSXP";
case CHARSXP: return "CHARSXP";
case LGLSXP: return "LGLSXP";
case INTSXP: return "INTSXP";
case REALSXP: return "REALSXP";
case CPLXSXP: return "CPLXSXP";
case STRSXP: return "STRSXP";
case DOTSXP: return "DOTSXP";
case ANYSXP: return "ANYSXP";
case VECSXP: return "VECSXP";
case EXPRSXP: return "EXPRSXP";
case BCODESXP: return "BCODESXP";
case EXTPTRSXP: return "EXTPTRSXP";
case WEAKREFSXP: return "WEAKREFSXP";
case S4SXP: return "S4SXP";
#if R_Version >= R_Version(4,4,0)
case OBJSXP: return "OBJSXP"; // replaces S4SXP in R 4.4.0
#endif
case S4SXP: return "S4SXP";
default:
return "<unknown>";
}
Expand Down

0 comments on commit 9fe7082

Please sign in to comment.