Skip to content

Commit 8992d83

Browse files
committed
add message() as a wrapper to base::message() (closes #1145)
1 parent 5530578 commit 8992d83

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2021-03-21 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/Rcpp/api/meat/message.h: Add wrapper for base::message
4+
* inst/include/Rcpp/api/meat/meat.h: Include new file
5+
16
2021-02-23 Dirk Eddelbuettel <[email protected]>
27

38
* Contributing.md: Update unit test link to tinytest

inst/include/Rcpp/api/meat/meat.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#include <Rcpp/api/meat/protection.h>
4343
#include <Rcpp/api/meat/wrap.h>
4444

45+
#include <Rcpp/api/meat/message.h>
46+
4547
#ifndef RCPP_NO_MODULES
4648
#include <Rcpp/api/meat/module/Module.h>
4749
#endif

inst/include/Rcpp/api/meat/message.h

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

0 commit comments

Comments
 (0)