[Box Backup-commit] COMMIT r3436 - box/trunk/lib/common

subversion at boxbackup.org subversion at boxbackup.org
Sat Dec 6 12:56:04 GMT 2014


Author: chris
Date: 2014-12-06 12:56:03 +0000 (Sat, 06 Dec 2014)
New Revision: 3436

Modified:
   box/trunk/lib/common/Utils.cpp
   box/trunk/lib/common/Utils.h
Log:
Fix compile on platforms without execinfo.h


Modified: box/trunk/lib/common/Utils.cpp
===================================================================
--- box/trunk/lib/common/Utils.cpp	2014-12-06 12:54:32 UTC (rev 3435)
+++ box/trunk/lib/common/Utils.cpp	2014-12-06 12:56:03 UTC (rev 3436)
@@ -15,7 +15,7 @@
 
 #include <cstdlib>
 
-#ifdef SHOW_BACKTRACE_ON_EXCEPTION
+#ifdef HAVE_EXECINFO_H
 	#include <execinfo.h>
 	#include <stdlib.h>
 #endif
@@ -95,7 +95,6 @@
 #endif*/
 }
 
-#ifdef SHOW_BACKTRACE_ON_EXCEPTION
 static std::string demangle(const std::string& mangled_name)
 {
 	std::string demangled_name = mangled_name;
@@ -146,6 +145,7 @@
 
 void DumpStackBacktrace()
 {
+#ifdef HAVE_EXECINFO_H
 	void  *array[20];
 	size_t size = backtrace(array, 20);
 	BOX_TRACE("Obtained " << size << " stack frames.");
@@ -182,8 +182,10 @@
 
 		BOX_TRACE(output.str());
 	}
+#else // !HAVE_EXECINFO_H
+	BOX_TRACE("Backtrace support was not compiled in");
+#endif // HAVE_EXECINFO_H
 }
-#endif // SHOW_BACKTRACE_ON_EXCEPTION
 
 
 

Modified: box/trunk/lib/common/Utils.h
===================================================================
--- box/trunk/lib/common/Utils.h	2014-12-06 12:54:32 UTC (rev 3435)
+++ box/trunk/lib/common/Utils.h	2014-12-06 12:56:03 UTC (rev 3436)
@@ -19,9 +19,7 @@
 
 void SplitString(std::string String, char SplitOn, std::vector<std::string> &rOutput);
 
-#ifdef SHOW_BACKTRACE_ON_EXCEPTION
-	void DumpStackBacktrace();
-#endif
+void DumpStackBacktrace();
 
 bool FileExists(const std::string& rFilename, int64_t *pFileSize = 0,
 	bool TreatLinksAsNotExisting = false);




More information about the Boxbackup-commit mailing list