diff options
author | Chris Robinson <[email protected]> | 2019-05-04 18:25:59 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-05-04 18:25:59 -0700 |
commit | b9592bddbc014759941b94b76596c1dbf2245ad3 (patch) | |
tree | 05155e98523f0c0a0fdc1e5c2a9102f0ee058912 | |
parent | 5ff8d5ae32943c5325172799f31b7c5b66c4f054 (diff) |
Add the printf format attribute to backend_exception's constructor
-rw-r--r-- | common/alexcpt.h | 9 |
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; } |