Skip to content

Commit 660e5be

Browse files
committed
Merge pull request #270 from RcppCore/feature/print-v2
Feature/print v2
2 parents 3f92f23 + c011634 commit 660e5be

File tree

8 files changed

+57
-15
lines changed

8 files changed

+57
-15
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2015-03-02 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/Rcpp/print.h (Rcpp): New inline function Rcpp::print()
4+
* inst/include/RcppCommon.h: Include new header
5+
6+
* src/api.cpp: Commented-out print() in global namespace
7+
* src/Rcpp_init.cpp: Commented-out registration of print()
8+
* inst/include/Rcpp/routines.h: Commented-out initialization
9+
110
2015-03-01 Dirk Eddelbuettel <[email protected]>
211

312
* src/api.cpp: New function print() as a wrapper around Rf_PrintValue()

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.11.4.9
4-
Date: 2015-03-01
3+
Version: 0.11.4.10
4+
Date: 2015-03-02
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey,
66
Douglas Bates, and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>

inst/NEWS.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
exception rather than crash) when a NULL external pointer is dereferenced.
1515
\item R code is evaluated within an \code{R_toplevelExec} block to prevent
1616
user interrupts from bypassing C++ destructors on the stack.
17-
\item A new function \code{print} function was added as a wrapper around
18-
\code{Rf_PrintValue}.
17+
\item A new inline header function \code{print} function was added as a
18+
wrapper around \code{Rf_PrintValue}.
1919
}
2020
\item Changes in Rcpp Attributes:
2121
\itemize{

inst/include/Rcpp/print.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2+
//
3+
// Copyright (C) 2015 Dirk Eddelbuettel
4+
//
5+
// This file is part of Rcpp.
6+
//
7+
// Rcpp is free software: you can redistribute it and/or modify it
8+
// under the terms of the GNU General Public License as published by
9+
// the Free Software Foundation, either version 2 of the License, or
10+
// (at your option) any later version.
11+
//
12+
// Rcpp is distributed in the hope that it will be useful, but
13+
// WITHOUT ANY WARRANTY; without even the implied warranty of
14+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
// GNU General Public License for more details.
16+
//
17+
// You should have received a copy of the GNU General Public License
18+
// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
19+
20+
#ifndef RCPP_PRINT_H
21+
#define RCPP_PRINT_H
22+
23+
namespace Rcpp {
24+
25+
inline void print(SEXP s) {
26+
Rf_PrintValue(s); // defined in Rinternals.h
27+
}
28+
29+
}
30+
31+
#endif
32+

inst/include/Rcpp/routines.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void setCurrentScope( Rcpp::Module* mod );
5959
SEXP reset_current_error();
6060
int error_occured();
6161
SEXP rcpp_get_current_error();
62-
void print(SEXP s);
62+
// void print(SEXP s);
6363

6464
#else
6565

@@ -245,11 +245,11 @@ inline attribute_hidden SEXP rcpp_get_current_error(){
245245
return fun();
246246
}
247247

248-
inline attribute_hidden void print(SEXP s) {
249-
typedef void (*Fun)(SEXP);
250-
static Fun fun = GET_CALLABLE("print");
251-
fun(s);
252-
}
248+
// inline attribute_hidden void print(SEXP s) {
249+
// typedef void (*Fun)(SEXP);
250+
// static Fun fun = GET_CALLABLE("print");
251+
// fun(s);
252+
// }
253253

254254
#endif
255255

inst/include/RcppCommon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ namespace Rcpp{
173173
#include <Rcpp/internal/SEXP_Iterator.h>
174174
#include <Rcpp/internal/converter.h>
175175

176+
#include <Rcpp/print.h>
176177
#include <Rcpp/algo.h>
177178

178179
#include <Rcpp/sugar/sugar_forward.h>

src/Rcpp_init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void registerFunctions(){
116116
RCPP_REGISTER(reset_current_error)
117117
RCPP_REGISTER(error_occured)
118118
RCPP_REGISTER(rcpp_get_current_error)
119-
RCPP_REGISTER(print)
119+
// RCPP_REGISTER(print)
120120
#undef RCPP_REGISTER
121121
}
122122

src/api.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,10 @@ SEXP stack_trace( const char* file, int line ){
298298
#endif
299299
}
300300

301-
// [[Rcpp::register]]
302-
void print(SEXP s) {
303-
Rf_PrintValue(s); // defined in Rinternals.h
304-
}
301+
// // [ [ Rcpp::register ] ]
302+
// void print(SEXP s) {
303+
// Rf_PrintValue(s); // defined in Rinternals.h
304+
// }
305305

306306
// }}}
307307

0 commit comments

Comments
 (0)