Portable C++ Stack Trace on Exception

后端 未结 7 1332
轮回少年
轮回少年 2020-12-15 08:53

I am writing a library that I would like to be portable. Thus, it should not depend on glibc or Microsoft extensions or anything else that is not in the standard. I have a

7条回答
  •  自闭症患者
    2020-12-15 09:24

    This will be slower but looks like it should work.

    From what I understand the problem in making a fast, portable, stack trace is that the stack implementation is both OS and CPU specific, so it is implicitly a platform specific problem. An alternative would be to use the MS/glibc functions and to use #ifdef and appropriate preprocessor defines (e.g. _WIN32) to implement the platform specific solutions in different builds.

提交回复
热议问题