diff options
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 13 | ||||
-rw-r--r-- | OpenAL32/alBuffer.c | 8 |
2 files changed, 14 insertions, 7 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 diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 53ee128a..972c4ece 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -28,9 +28,6 @@ #include "alError.h" #include "alBuffer.h" -#ifdef _DEBUG - char szDebug[256]; -#endif /* * AL Buffer Functions @@ -966,10 +963,7 @@ ALvoid ReleaseALBuffers(ALvoid) #ifdef _DEBUG if(g_uiBufferCount > 0) - { - sprintf(szDebug, "OpenAL32 : DllMain() %d Buffer(s) NOT deleted\n", g_uiBufferCount); - OutputDebugString(szDebug); - } + AL_PRINT("exit() %d Buffer(s) NOT deleted\n", g_uiBufferCount); #endif ALBuffer = g_pBuffers; |