I learned about Visual C++ Structured Exception Handling (SEH) recently. I am considering implementing it, but my code is supposed to be as cross platform as possible. In the future, I'm thinking of porting ny code to Linux, MAC, Android, IOS and potentially consoles. Is SEH something that can work on all of these platforms?!
Asked
Active
Viewed 96 times
0
-
No, is the simple answer. – john Jul 28 '22 at 20:50
-
[This](https://stackoverflow.com/questions/2782915/what-should-i-know-about-structured-exceptions-seh-in-c) might be interesting – john Jul 28 '22 at 20:53
-
Sadly not. The magic that is `SEH` is Windows-only, nothing else comes close. – Paul Sanders Jul 28 '22 at 22:35
1 Answers
3
SEH is a Microsoft-specific extension. Clang-cl has partial support for SEH (on Windows platforms), which could presumably be adapted for use on other OSes, but it wouldn’t be straightforward and it wouldn’t offer support for the sorts of things you can catch with SEH but not standard C++ extensions. Don’t use SEH if you want to write platform-independent code.

Sneftel
- 40,271
- 12
- 71
- 104