diff options
author | Chris Robinson <[email protected]> | 2013-10-28 17:09:52 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-10-28 17:09:52 -0700 |
commit | 0a6eff6a890a4ae3327db542594a1d66fc645a05 (patch) | |
tree | 26cc5eaf351d75e35f58e9a7cbe1b385347a1918 /OpenAL32 | |
parent | 6fd857739c3aa9534f333153d8d7067322974dd3 (diff) |
Add a GNU-specific AL_PRINT
This one makes use of the ', ## __VA_ARGS__' construct to avoid
splitting the output into two *printf calls.
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 256275f2..685536b5 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -571,10 +571,16 @@ ALfloat CalcHrtfDelta(ALfloat oldGain, ALfloat newGain, const ALfloat olddir[3], void GetLerpedHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat (*coeffs)[2], ALuint *delays); ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat delta, ALint counter, ALfloat (*coeffs)[2], ALuint *delays, ALfloat (*coeffStep)[2], ALint *delayStep); -void al_print(const char *type, const char *func, const char *fmt, ...) PRINTF_STYLE(3,4); -#define AL_PRINT(T, ...) al_print((T), __FUNCTION__, __VA_ARGS__) extern FILE *LogFile; + +#ifdef __GNUC__ +#define AL_PRINT(T, MSG, ...) fprintf(LogFile, "AL lib: %s %s: "MSG, T, __FUNCTION__ , ## __VA_ARGS__) +#else +void al_print(const char *type, const char *func, const char *fmt, ...) PRINTF_STYLE(3,4); +#define AL_PRINT(T, MSG, ...) al_print((T), __FUNCTION__, MSG, __VA_ARGS__) +#endif + enum LogLevel { NoLog, LogError, |