From 460a01443c925013f3f9dadeab5d07373ac5c894 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 9 Apr 2019 20:48:01 -0700 Subject: 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). --- common/alexcpt.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/alexcpt.h (limited to 'common') 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 + + +#define START_API_FUNC try + +#define END_API_FUNC catch(...) { std::terminate(); } + +#endif /* ALEXCPT_H */ -- cgit v1.2.3