]> git.tdb.fi Git - libs/core.git/blobdiff - source/debug/exceptiontrace.cpp
Use nullptr instead of 0 for pointers
[libs/core.git] / source / debug / exceptiontrace.cpp
index 30df4b6f353718c687774878c04e0f4252b4e9b6..7a681c35010cee85277112cc2d5b9a5d7ec5fefa 100644 (file)
@@ -20,7 +20,7 @@ struct HookThrow
 
 HookThrow::HookThrow()
 {
-       void *handle = dlopen(0, RTLD_LAZY);
+       void *handle = dlopen(nullptr, RTLD_LAZY);
        orig_cxa_throw = reinterpret_cast<CxaThrowType *>(dlvsym(handle, "__cxa_throw", "CXXABI_1.3"));
        dlclose(handle);
 }
@@ -32,13 +32,7 @@ bool trace_enabled = false;
 
 Msp::Debug::Backtrace &get_thread_backtrace()
 {
-#if __cplusplus>=201103L
        static thread_local Msp::Debug::Backtrace backtrace;
-#elif defined(__GNUC__)
-       static __thread Msp::Debug::Backtrace backtrace;
-#else
-       static Msp::Debug::Backtrace backtrace;
-#endif
        return backtrace;
 }
 
@@ -61,11 +55,11 @@ const Backtrace &get_exception_trace()
 } // namespace Msp
 
 #if defined(WITH_EXCEPTION_TRACE) && !defined(_WIN32) && defined(__GLIBC__)
-extern "C" void __cxa_throw(void *exc, std::type_info *type, void (*dest) (void *))
+extern "C" void __cxa_throw(void *exc, type_info *type, void (*dest) (void *))
 {
        if(trace_enabled)
                get_thread_backtrace() = Msp::Debug::Backtrace::create();
        orig_cxa_throw(exc, type, dest);
-       std::terminate();
+       terminate();
 }
 #endif