diff options
-rw-r--r-- | OpenAL32/alError.c | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/OpenAL32/alError.c b/OpenAL32/alError.c index 56f4248e..d18c1867 100644 --- a/OpenAL32/alError.c +++ b/OpenAL32/alError.c @@ -28,21 +28,6 @@ ALboolean TrapALError = AL_FALSE; -AL_API ALenum AL_APIENTRY alGetError(void) -{ - ALCcontext *Context; - ALenum errorCode; - - Context = GetContextRef(); - if(!Context) return AL_INVALID_OPERATION; - - errorCode = ExchangeInt(&Context->LastError, AL_NO_ERROR); - - ALCcontext_DecRef(Context); - - return errorCode; -} - ALvoid alSetError(ALCcontext *Context, ALenum errorCode) { if(TrapALError) @@ -57,3 +42,30 @@ ALvoid alSetError(ALCcontext *Context, ALenum errorCode) } CompExchangeInt(&Context->LastError, AL_NO_ERROR, errorCode); } + +AL_API ALenum AL_APIENTRY alGetError(void) +{ + ALCcontext *Context; + ALenum errorCode; + + Context = GetContextRef(); + if(!Context) + { + if(TrapALError) + { +#ifdef _WIN32 + if(IsDebuggerPresent()) + DebugBreak(); +#elif defined(SIGTRAP) + raise(SIGTRAP); +#endif + } + return AL_INVALID_OPERATION; + } + + errorCode = ExchangeInt(&Context->LastError, AL_NO_ERROR); + + ALCcontext_DecRef(Context); + + return errorCode; +} |