diff options
author | Chris Robinson <[email protected]> | 2007-11-30 00:28:34 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2007-11-30 00:28:34 -0800 |
commit | ab34e7c613aad78e193ba6f8a4d5631f1ba6a613 (patch) | |
tree | b50af3eed21b778be4599f5cd90b4c96ffb2616c /OpenAL32/Include/alMain.h | |
parent | aea161d98774d1281df02ae6231348890c5a0f3f (diff) |
Use an AL_PRINT macro for printing lib messages/errors to the console
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r-- | OpenAL32/Include/alMain.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 3d34cf38..9957a741 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -62,6 +62,19 @@ extern "C" { #endif +extern char szDebug[256]; + +#define AL_PRINT(...) do { \ + int _al_print_i; \ + char *_al_print_fn = strrchr(__FILE__, '/'); \ + if(!_al_print_fn) _al_print_fn = __FILE__; \ + else _al_print_fn += 1; \ + _al_print_i = snprintf(szDebug, sizeof(szDebug), "AL lib: %s:%d: ", _al_print_fn, __LINE__); \ + snprintf(szDebug+_al_print_i, sizeof(szDebug)-_al_print_i, __VA_ARGS__); \ + fprintf(stderr, "%s", szDebug); \ +} while(0) + + #define AL_FORMAT_MONO_IMA4 0x1300 #define AL_FORMAT_STEREO_IMA4 0x1301 // These are from AL_EXT_MCFORMATS, which we don't support yet but the mixer |