Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OBJSXP coming in R 4.4.0 (closes #1283) #1293

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2023-12-27 Dirk Eddelbuettel <[email protected]>

* src/api.cpp (type2name): Refine OBJSXP return

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
48 changes: 26 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,34 @@ 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) // 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";
#endif
default:
return "<unknown>";
}
Expand Down