Copyright © 2007 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
-#ifndef WIN32
+
+// Must include something to test for glibc
+#include <cstdlib>
+#if !defined(WIN32) && defined(__GLIBC__)
#include <dlfcn.h>
#include <execinfo.h>
#endif
Backtrace Backtrace::create()
{
-#ifndef WIN32
+#if !defined(WIN32) && defined(__GLIBC__)
void *addresses[50];
int count=::backtrace(addresses, 50);
- //char **symbols=backtrace_symbols(addresses, count);
-
Backtrace bt;
Dl_info dli;
for(int i=0; i<count; ++i)
bt.frames.push_back(frame);
}
- //free(symbols);
-
return bt;
#else
return Backtrace();