aboutsummaryrefslogtreecommitdiffstats
path: root/common/alexcpt.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-05-04 18:25:59 -0700
committerChris Robinson <[email protected]>2019-05-04 18:25:59 -0700
commitb9592bddbc014759941b94b76596c1dbf2245ad3 (patch)
tree05155e98523f0c0a0fdc1e5c2a9102f0ee058912 /common/alexcpt.h
parent5ff8d5ae32943c5325172799f31b7c5b66c4f054 (diff)
Add the printf format attribute to backend_exception's constructor
Diffstat (limited to 'common/alexcpt.h')
-rw-r--r--common/alexcpt.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/common/alexcpt.h b/common/alexcpt.h
index b4f6f55e..ff09bab2 100644
--- a/common/alexcpt.h
+++ b/common/alexcpt.h
@@ -7,6 +7,13 @@
#include "AL/alc.h"
+#ifdef __GNUC__
+#define ALEXCPT_FORMAT(x, y, z) __attribute__((format(x, (y), (z))))
+#else
+#define ALEXCPT_FORMAT(x, y, z)
+#endif
+
+
namespace al {
class backend_exception final : public std::exception {
@@ -14,7 +21,7 @@ class backend_exception final : public std::exception {
ALCenum mErrorCode;
public:
- backend_exception(ALCenum code, const char *msg, ...);
+ backend_exception(ALCenum code, const char *msg, ...) ALEXCPT_FORMAT(printf, 3,4);
const char *what() const noexcept override { return mMessage.c_str(); }
ALCenum errorCode() const noexcept { return mErrorCode; }