Workaround mingw complaining about the %z formatter

master
Chris Robinson 2021-03-12 03:14:29 -08:00
parent ca0a6024a3
commit c1f0555fef
6 changed files with 30 additions and 3 deletions

View File

@ -12,7 +12,11 @@ class effect_exception final : public al::base_exception {
ALenum mErrorCode;
public:
#ifdef __USE_MINGW_ANSI_STDIO
[[gnu::format(gnu_printf, 3, 4)]]
#else
[[gnu::format(printf, 3, 4)]]
#endif
effect_exception(ALenum code, const char *msg, ...);
ALenum errorCode() const noexcept { return mErrorCode; }

View File

@ -52,7 +52,11 @@ class filter_exception final : public al::base_exception {
ALenum mErrorCode;
public:
#ifdef __USE_MINGW_ANSI_STDIO
[[gnu::format(gnu_printf, 3, 4)]]
#else
[[gnu::format(printf, 3, 4)]]
#endif
filter_exception(ALenum code, const char *msg, ...) : mErrorCode{code}
{
std::va_list args;

View File

@ -342,7 +342,12 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice> {
void renderSamples(void *outBuffer, const uint numSamples, const size_t frameStep);
/* Caller must lock the device state, and the mixer must not be running. */
[[gnu::format(printf,2,3)]] void handleDisconnect(const char *msg, ...);
#ifdef __USE_MINGW_ANSI_STDIO
[[gnu::format(gnu_printf,2,3)]]
#else
[[gnu::format(printf,2,3)]]
#endif
void handleDisconnect(const char *msg, ...);
DEF_NEWDEL(ALCdevice)
};

View File

@ -259,7 +259,12 @@ struct ALCcontext : public al::intrusive_ref<ALCcontext> {
/** Resumes update processing after being deferred. */
void processUpdates();
[[gnu::format(printf,3,4)]] void setError(ALenum errorCode, const char *msg, ...);
#ifdef __USE_MINGW_ANSI_STDIO
[[gnu::format(gnu_printf, 3, 4)]]
#else
[[gnu::format(printf, 3, 4)]]
#endif
void setError(ALenum errorCode, const char *msg, ...);
DEF_NEWDEL(ALCcontext)
};

View File

@ -103,7 +103,11 @@ class backend_exception final : public base_exception {
backend_error mErrorCode;
public:
#ifdef __USE_MINGW_ANSI_STDIO
[[gnu::format(gnu_printf, 3, 4)]]
#else
[[gnu::format(printf, 3, 4)]]
#endif
backend_exception(backend_error code, const char *msg, ...) : mErrorCode{code}
{
std::va_list args;

View File

@ -35,7 +35,12 @@ extern FILE *gLogFile;
#else
[[gnu::format(printf,3,4)]] void al_print(LogLevel level, FILE *logfile, const char *fmt, ...);
#ifdef __USE_MINGW_ANSI_STDIO
[[gnu::format(gnu_printf,3,4)]]
#else
[[gnu::format(printf,3,4)]]
#endif
void al_print(LogLevel level, FILE *logfile, const char *fmt, ...);
#define TRACE(...) al_print(LogLevel::Trace, gLogFile, "[ALSOFT] (II) " __VA_ARGS__)