]> git.tdb.fi Git - libs/core.git/blobdiff - source/debug/backtrace.cpp
Add move semantics to Variant
[libs/core.git] / source / debug / backtrace.cpp
index 1fda155e9665d497f629cb575ea93a33b12a7d3b..1236145aa67088d0b2aae1fd02031bd4b14068a6 100644 (file)
@@ -1,6 +1,6 @@
 // Must include something to test for glibc
 #include <cstdlib>
-#if !defined(WIN32) && defined(__GLIBC__)
+#if !defined(_WIN32) && defined(__GLIBC__)
 #include <dlfcn.h>
 #include <execinfo.h>
 #endif
@@ -14,7 +14,7 @@ namespace Debug {
 
 Backtrace Backtrace::create()
 {
-#if !defined(WIN32) && defined(__GLIBC__)
+#if !defined(_WIN32) && defined(__GLIBC__)
        void *addresses[50];
        int count = ::backtrace(addresses, 50);
 
@@ -43,19 +43,18 @@ Backtrace Backtrace::create()
 
 ostream &operator<<(ostream &out, const Backtrace &bt)
 {
-       const list<Backtrace::StackFrame> &frames = bt.get_frames();
-       for(list<Backtrace::StackFrame>::const_iterator i=frames.begin(); i!=frames.end(); ++i)
-               out<<*i<<'\n';
+       for(const Backtrace::StackFrame &f: bt.get_frames())
+               out << f << '\n';
 
        return out;
 }
 
 ostream &operator<<(ostream &out, const Backtrace::StackFrame &sf)
 {
-       out<<sf.address;
+       out << sf.address;
        if(!sf.symbol.empty())
-               out<<" in "<<sf.symbol;
-       out<<" from "<<sf.file;
+               out << " in " << sf.symbol;
+       out << " from " << sf.file;
 
        return out;
 }