[Rcpp-commits] r1143 - in pkg/Rcpp: inst/include/Rcpp src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 3 20:00:11 CEST 2010


Author: romain
Date: 2010-05-03 20:00:11 +0200 (Mon, 03 May 2010)
New Revision: 1143

Modified:
   pkg/Rcpp/inst/include/Rcpp/exceptions.h
   pkg/Rcpp/src/exceptions.cpp
Log:
trying to force not_compatible to be defined in Rcpp

Modified: pkg/Rcpp/inst/include/Rcpp/exceptions.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/exceptions.h	2010-05-02 21:24:24 UTC (rev 1142)
+++ pkg/Rcpp/inst/include/Rcpp/exceptions.h	2010-05-03 18:00:11 UTC (rev 1143)
@@ -49,7 +49,7 @@
 public:                                                                        \
 	__CLASS__( const std::string& message ) throw() : message( __WHAT__ ){} ;  \
 	virtual ~__CLASS__() throw(){} ;                                           \
-	virtual const char* what() const throw(){ return message.c_str() ; } ;     \
+	virtual const char* what() const throw() ;                                 \
 private:                                                                       \
 	std::string message ;                                                      \
 } ;

Modified: pkg/Rcpp/src/exceptions.cpp
===================================================================
--- pkg/Rcpp/src/exceptions.cpp	2010-05-02 21:24:24 UTC (rev 1142)
+++ pkg/Rcpp/src/exceptions.cpp	2010-05-03 18:00:11 UTC (rev 1143)
@@ -28,6 +28,21 @@
 		UNPROTECT(1) ;
 	}
 	exception::~exception() throw(){}
+
+#define RCPP_EXCEPTION_WHAT(__CLASS__) \
+const char* __CLASS__::what() const throw(){ return message.c_str(); }
+
+RCPP_EXCEPTION_WHAT(not_compatible)
+RCPP_EXCEPTION_WHAT(S4_creation_error)
+RCPP_EXCEPTION_WHAT(no_such_binding)
+RCPP_EXCEPTION_WHAT(binding_not_found)
+RCPP_EXCEPTION_WHAT(binding_is_locked)
+RCPP_EXCEPTION_WHAT(no_such_namespace)
+RCPP_EXCEPTION_WHAT(eval_error)
+
+#undef RCPP_EXCEPTION_WHAT
+
+
 }
 
 /* for now, the fancy exception handling is only available in GCC, 



More information about the Rcpp-commits mailing list