aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--al/effect.cpp9
-rw-r--r--al/filter.cpp2
-rw-r--r--alc/effects/base.h8
-rw-r--r--common/alexcpt.cpp3
-rw-r--r--common/alexcpt.h1
5 files changed, 15 insertions, 8 deletions
diff --git a/al/effect.cpp b/al/effect.cpp
index 3324228a..cb29ae8b 100644
--- a/al/effect.cpp
+++ b/al/effect.cpp
@@ -70,6 +70,15 @@ const EffectList gEffectList[15]{
bool DisabledEffects[MAX_EFFECTS];
+
+effect_exception::effect_exception(ALenum code, const char *msg, ...) : base_exception{code}
+{
+ std::va_list args;
+ va_start(args, msg);
+ setMessage(msg, args);
+ va_end(args);
+}
+
namespace {
constexpr struct FactoryItem {
diff --git a/al/filter.cpp b/al/filter.cpp
index a861c8cd..8d24b87d 100644
--- a/al/filter.cpp
+++ b/al/filter.cpp
@@ -52,7 +52,7 @@ public:
[[gnu::format(printf, 3, 4)]]
filter_exception(ALenum code, const char *msg, ...) : base_exception{code}
{
- va_list args;
+ std::va_list args;
va_start(args, msg);
setMessage(msg, args);
va_end(args);
diff --git a/alc/effects/base.h b/alc/effects/base.h
index 83071d0e..1ddc2f07 100644
--- a/alc/effects/base.h
+++ b/alc/effects/base.h
@@ -129,13 +129,7 @@ union EffectProps {
class effect_exception final : public al::base_exception {
public:
[[gnu::format(printf, 3, 4)]]
- effect_exception(ALenum code, const char *msg, ...) : base_exception{code}
- {
- va_list args;
- va_start(args, msg);
- setMessage(msg, args);
- va_end(args);
- }
+ effect_exception(ALenum code, const char *msg, ...);
};
diff --git a/common/alexcpt.cpp b/common/alexcpt.cpp
index 111258a0..6fbc63fd 100644
--- a/common/alexcpt.cpp
+++ b/common/alexcpt.cpp
@@ -11,6 +11,9 @@
namespace al {
+/* Defined here to avoid inlining it. */
+base_exception::~base_exception() { }
+
void base_exception::setMessage(const char* msg, std::va_list args)
{
std::va_list args2;
diff --git a/common/alexcpt.h b/common/alexcpt.h
index b399e8f7..5b33f092 100644
--- a/common/alexcpt.h
+++ b/common/alexcpt.h
@@ -17,6 +17,7 @@ class base_exception : public std::exception {
protected:
base_exception(ALCenum code) : mErrorCode{code} { }
+ virtual ~base_exception();
void setMessage(const char *msg, std::va_list args);