MeshLib C++ Docs
Loading...
Searching...
No Matches
MRStacktrace.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4
5#ifndef __EMSCRIPTEN__
6
7#include <string>
8
9#ifdef _WIN32
11#include <version>
12#if __cpp_lib_stacktrace >= 202011
13#pragma message("std::stacktrace is available")
14#include <stacktrace>
15#else
16#pragma message("std::stacktrace is NOT available, using boost::stacktrace instead")
17#include <boost/stacktrace.hpp>
18#endif
19#else
20#include <boost/stacktrace.hpp>
21#endif
22
23namespace MR
24{
27
28
32[[nodiscard]] inline std::string getCurrentStacktraceInline()
33{
34#if defined _WIN32 && __cpp_lib_stacktrace >= 202011
35 return to_string( std::stacktrace::current() );
36#else
37 return to_string( boost::stacktrace::stacktrace() );
38#endif
39}
40
42MRMESH_API void printStacktraceOnCrash();
43
44}
45
46#endif
MRMESH_API void printStacktraceOnCrash()
Print stacktrace on application crash.
std::string getCurrentStacktraceInline()
Definition MRStacktrace.h:32
only for bindings generation
Definition MRCameraOrientationPlugin.h:8