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#include <version>
10#if __cpp_lib_stacktrace >= 202011
11#pragma message("std::stacktrace is available")
12#include <stacktrace>
13#else
14#pragma message("std::stacktrace is NOT available, using boost::stacktrace instead")
15#include <boost/stacktrace.hpp>
16#endif
17
18namespace MR
19{
22
23
27[[nodiscard]] inline std::string getCurrentStacktraceInline()
28{
29#if __cpp_lib_stacktrace >= 202011
30 return to_string( std::stacktrace::current() );
31#else
32 return to_string( boost::stacktrace::stacktrace() );
33#endif
34}
35
38
39}
40
41#endif
#define MRMESH_API
Definition MRMeshFwd.h:85
void printStacktraceOnCrash()
Print stacktrace on application crash.
std::string getCurrentStacktraceInline()
Definition MRStacktrace.h:27
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8