From 185a38bfb009d7a05eb147221f463d4ad91ed732 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Sun, 22 Dec 2024 17:05:12 -0600 Subject: [PATCH 1/2] Condition undoing of Rmath prefixes on R < 4.5.0 --- DESCRIPTION | 4 ++-- inst/NEWS.Rd | 2 ++ inst/include/Rcpp/sugar/undoRmath.h | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1eec8dc2d..8e70f1cbb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Rcpp Title: Seamless R and C++ Integration -Version: 1.0.13.6 -Date: 2024-11-25 +Version: 1.0.13.6.1 +Date: 2024-12-21 Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org", comment = c(ORCID = "0000-0001-6419-907X")), person("Romain", "Francois", role = "aut", diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 920c2508f..95fd9305d 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -17,6 +17,8 @@ \ghpr{1338}) \item Use read-only \code{VECTOR_PTR} and \code{STRING_PTR} only with with R 4.5.0 or later (Kevin in \ghpr{1342} fixing \ghit{1341}) + \item As R 4.5.0 or later prefix math functions, make undefine in Rcpp + Sugar version dependent (Dirk in \ghpr{1352} fixing \ghit{1351}) } \item Changes in Rcpp Attributes: \itemize{ diff --git a/inst/include/Rcpp/sugar/undoRmath.h b/inst/include/Rcpp/sugar/undoRmath.h index c718b724a..2288ad767 100644 --- a/inst/include/Rcpp/sugar/undoRmath.h +++ b/inst/include/Rcpp/sugar/undoRmath.h @@ -1,8 +1,6 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- -// // undoRmath.h: Rcpp R/C++ interface class library -- undo the macros set by Rmath.h // -// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2024 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -22,7 +20,17 @@ #ifndef RCPP_SUGAR_UNDORMATH_H #define RCPP_SUGAR_UNDORMATH_H -// undo some of the mess of Rmath +// Reverse-depends checks found rare cases where R_Version would not evaluate +// So here we, if needed, we first undefine ... +#ifdef R_Version +#undef R_Version +#endif +// ... and then repeat the definition from Rversion.h +#define R_Version(v,p,s) (((v) * 65536) + ((p) * 256) + (s)) + +// Undo some of the definitions in Rmath -- but only prior to R 4.5.0 +#if R_VERSION < R_Version(4,5,0) + #undef sign #undef trunc #undef rround @@ -163,5 +171,6 @@ #undef tetragamma #undef trigamma +#endif #endif From 44bbfc9aca2aeaa87a33b4615d593e1a17d59a06 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Sun, 22 Dec 2024 17:19:16 -0600 Subject: [PATCH 2/2] Changelog entry for #1352 [ci skip] --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index ab1ecef36..57a4b6cee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-12-22 Dirk Eddelbuettel + + * inst/include/Rcpp/sugar/undoRmath.h: Condition undefining of + non-prefixed Rmath functions in R < 4.5.0; redefine R_Version macro + 2024-11-25 Dirk Eddelbuettel * DESCRIPTION (Version, Date): Roll micro version to 1.0.13.6 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy