]> git.tdb.fi Git - libs/core.git/blobdiff - source/debug/backtrace.cpp
Use C++11 features with containers
[libs/core.git] / source / debug / backtrace.cpp
index f43a9edacccb2655eaaf42e094e4d5f74dd8742f..de1f76e910611ee6dd95be1fadcda9dc727e4ff8 100644 (file)
@@ -1,13 +1,6 @@
-/* $Id$
-
-This file is part of libmspcore
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 // 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
@@ -21,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);
 
@@ -50,9 +43,8 @@ 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;
 }