diff options
author | Chris Robinson <[email protected]> | 2019-04-09 20:48:01 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-04-09 20:48:01 -0700 |
commit | 460a01443c925013f3f9dadeab5d07373ac5c894 (patch) | |
tree | 10d4f7bbe3eeec95f462403574a335b9e9b05495 /common | |
parent | e6daab51e8cd06c66680eb88e4b83ca3fb5918b0 (diff) |
Add macros to stop exceptions from leaving API functions
Effectively makes the functions act as noexcept, since there's no meaningful
reason to propogate exceptions from "C" functions. Currently only applied to
ALC functions, but can incrementally be applied to AL functions too. In the
future, this could also handle ALC and AL errors with unique exception types
(functions that utilize this behavior would need to ensure proper cleanup).
Diffstat (limited to 'common')
-rw-r--r-- | common/alexcpt.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/alexcpt.h b/common/alexcpt.h new file mode 100644 index 00000000..3e31667e --- /dev/null +++ b/common/alexcpt.h @@ -0,0 +1,11 @@ +#ifndef ALEXCPT_H +#define ALEXCPT_H + +#include <exception> + + +#define START_API_FUNC try + +#define END_API_FUNC catch(...) { std::terminate(); } + +#endif /* ALEXCPT_H */ |