[Rcpp-commits] r951 - pkg/Rcpp/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 30 10:57:41 CEST 2010


Author: romain
Date: 2010-03-30 10:57:41 +0200 (Tue, 30 Mar 2010)
New Revision: 951

Modified:
   pkg/Rcpp/src/debugging.cpp
Log:
slightly better version of stack_trace (still useless) on windows

Modified: pkg/Rcpp/src/debugging.cpp
===================================================================
--- pkg/Rcpp/src/debugging.cpp	2010-03-30 06:24:15 UTC (rev 950)
+++ pkg/Rcpp/src/debugging.cpp	2010-03-30 08:57:41 UTC (rev 951)
@@ -21,7 +21,18 @@
 
 #include <Rcpp.h>
 
-#if defined(__GNUC__) && !defined(WIN32)
+#if defined(__GNUC__)
+#if defined(WIN32)
+/* silly version for windows */
+SEXP stack_trace( const char* file, int line ){
+    Rcpp::List trace = Rcpp::List::create( 
+    	Rcpp::Named( "file"  ) = file, 
+    	Rcpp::Named( "line"  ) = line, 
+    	Rcpp::Named( "stack" ) = "C++ stack not available on windows (mingw does not have the execinfo.h file)" ) ;
+    trace.attr("class") = "Rcpp_stack_trace" ;
+    return trace ;
+}
+#else /* !defined(WIN32) */ 
 #include <execinfo.h>
 #include <cxxabi.h>
 
@@ -62,8 +73,8 @@
     trace.attr("class") = "Rcpp_stack_trace" ;
     return trace ;
 }
-
-#else
+#endif 
+#else /* !defined( __GNUC__ ) */
 SEXP stack_trace( const char *file, int line) {
 	return R_NilValue ;
 }



More information about the Rcpp-commits mailing list