[mlpack-svn] r11831 - mlpack/trunk/src/mlpack/core/util

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Mar 12 15:22:42 EDT 2012


Author: rcurtin
Date: 2012-03-12 15:22:42 -0400 (Mon, 12 Mar 2012)
New Revision: 11831

Modified:
   mlpack/trunk/src/mlpack/core/util/log.cpp
Log:
Only give stacktraces on Linux boxes; Windows doesn't have execinfo.h or cxxabi.h.

Modified: mlpack/trunk/src/mlpack/core/util/log.cpp
===================================================================
--- mlpack/trunk/src/mlpack/core/util/log.cpp	2012-03-12 19:19:22 UTC (rev 11830)
+++ mlpack/trunk/src/mlpack/core/util/log.cpp	2012-03-12 19:22:42 UTC (rev 11831)
@@ -4,8 +4,10 @@
  *
  * Implementation of the Log class.
  */
-#include <cxxabi.h>
-#include <execinfo.h>
+#ifndef _WIN32
+  #include <cxxabi.h>
+  #include <execinfo.h>
+#endif
 
 #include "log.hpp"
 
@@ -42,6 +44,7 @@
 {
   if (!condition)
   {
+#ifndef _WIN32
     void* array[25];
     size_t size = backtrace (array, sizeof(array)/sizeof(void*));
     char** messages = backtrace_symbols(array, size);
@@ -103,8 +106,12 @@
           Log::Debug << "[bt]: (" << i << ") " << messages[i] << std::endl;
       }
     }
+#endif
     Log::Debug << message << std::endl;
+
+#ifndef _WIN32
     free(messages);
+#endif
 
     //backtrace_symbols_fd (array, size, 2);
     exit(1);




More information about the mlpack-svn mailing list