[Rcpp-commits] r4096 - in pkg/Rcpp: inst/include inst/include/Rcpp inst/include/Rcpp/api/meat src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Dec 6 02:44:59 CET 2012
Author: romain
Date: 2012-12-06 02:44:59 +0100 (Thu, 06 Dec 2012)
New Revision: 4096
Modified:
pkg/Rcpp/inst/include/Rcpp/api/meat/meat.h
pkg/Rcpp/inst/include/Rcpp/exceptions.h
pkg/Rcpp/inst/include/RcppCommon.h
pkg/Rcpp/src/exceptions.cpp
Log:
includes
Modified: pkg/Rcpp/inst/include/Rcpp/api/meat/meat.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/api/meat/meat.h 2012-12-06 01:20:19 UTC (rev 4095)
+++ pkg/Rcpp/inst/include/Rcpp/api/meat/meat.h 2012-12-06 01:44:59 UTC (rev 4096)
@@ -24,6 +24,5 @@
#include <Rcpp/api/meat/RObject.h>
#include <Rcpp/api/meat/DottedPair.h>
-#include <Rcpp/api/meat/grow.h>
#endif
Modified: pkg/Rcpp/inst/include/Rcpp/exceptions.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/exceptions.h 2012-12-06 01:20:19 UTC (rev 4095)
+++ pkg/Rcpp/inst/include/Rcpp/exceptions.h 2012-12-06 01:44:59 UTC (rev 4096)
@@ -2,7 +2,7 @@
//
// exceptions.h: Rcpp R/C++ interface class library -- exceptions
//
-// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
@@ -22,8 +22,14 @@
#ifndef Rcpp__exceptions__h
#define Rcpp__exceptions__h
+#define R_NO_REMAP
+#include <Rinternals.h>
#include <sstream>
+#include <Rcpp/routines.h>
+SEXP stack_trace( const char *file, int line) ;
+#define GET_STACKTRACE() stack_trace( __FILE__, __LINE__ )
+
namespace Rcpp{
class exception : public std::exception {
@@ -121,4 +127,10 @@
} // namesapce Rcpp
+void forward_uncaught_exceptions_to_r() ;
+void forward_exception_to_r( const std::exception& ) ;
+
+std::string demangle( const std::string& name) ;
+#define DEMANGLE(__TYPE__) demangle( typeid(__TYPE__).name() ).c_str()
+
#endif
Modified: pkg/Rcpp/inst/include/RcppCommon.h
===================================================================
--- pkg/Rcpp/inst/include/RcppCommon.h 2012-12-06 01:20:19 UTC (rev 4095)
+++ pkg/Rcpp/inst/include/RcppCommon.h 2012-12-06 01:44:59 UTC (rev 4096)
@@ -215,9 +215,6 @@
#endif
#endif
-std::string demangle( const std::string& name) ;
-#define DEMANGLE(__TYPE__) demangle( typeid(__TYPE__).name() ).c_str()
-
// include R headers, but set R_NO_REMAP and access everything via Rf_ prefixes
#define R_NO_REMAP
#include <R.h>
@@ -258,11 +255,6 @@
extern "C" SEXP rcpp_call_test(SEXP x) ;
-/* in exceptions.cpp */
-void forward_uncaught_exceptions_to_r() ;
-void forward_exception_to_r( const std::exception& ) ;
-RcppExport SEXP initUncaughtExceptionHandler() ;
-
/* just testing variadic templates */
#ifdef HAS_VARIADIC_TEMPLATES
template<typename... Args>
@@ -300,8 +292,6 @@
#include <Rcpp/macros/debug.h>
-SEXP stack_trace( const char *file, int line) ;
-#define GET_STACKTRACE() stack_trace( __FILE__, __LINE__ )
#define Rcpp_error(MESSAGE) throw Rcpp::exception( MESSAGE, __FILE__, __LINE__ )
namespace Rcpp {
Modified: pkg/Rcpp/src/exceptions.cpp
===================================================================
--- pkg/Rcpp/src/exceptions.cpp 2012-12-06 01:20:19 UTC (rev 4095)
+++ pkg/Rcpp/src/exceptions.cpp 2012-12-06 01:44:59 UTC (rev 4096)
@@ -19,9 +19,14 @@
// You should have received a copy of the GNU General Public License
// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
-#include <Rcpp.h>
+// #include <Rcpp.h>
+#define R_NO_REMAP
+#include <R.h>
+#include <Rinternals.h>
+#include <Rcpp/exceptions.h>
namespace Rcpp{
+
exception::exception(const char* message_) : message(message_) {}
exception::exception( const char* message_, const char* file, int line) : message(message_){
rcpp_set_stack_trace( stack_trace(file,line) ) ;
@@ -32,7 +37,6 @@
const char* __CLASS__::what() const throw(){ return message.c_str(); }
RCPP_EXCEPTION_WHAT(exception)
-
RCPP_EXCEPTION_WHAT(not_compatible)
RCPP_EXCEPTION_WHAT(S4_creation_error)
RCPP_EXCEPTION_WHAT(reference_creation_error)
@@ -189,10 +193,4 @@
return name ;
}
#endif
-SEXP initUncaughtExceptionHandler(){
- /* FIXME: we might want to restore the original handler as the package
- gets unloaded */
- std::set_terminate(forward_uncaught_exceptions_to_r);
- return R_NilValue ;
-}
More information about the Rcpp-commits
mailing list