zenilib: zenilib/jni/external/openal-soft/OpenAL32/alError.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
alError.c
Go to the documentation of this file.
1
21 #include "config.h"
22
23 #include <signal.h>
24
25 #include "alMain.h"
26 #include "AL/alc.h"
27 #include "alError.h"
28
29 ALboolean TrapALError = AL_FALSE;
30
31 ALvoid alSetError(ALCcontext *Context, ALenum errorCode)
32 {
33 if(TrapALError)
34 {
35 #ifdef _WIN32
36 /* DebugBreak will cause an exception if there is no debugger */
37 if(IsDebuggerPresent())
38 DebugBreak();
39 #elif defined(SIGTRAP)
40 raise(SIGTRAP);
41 #endif
42 }
43 CompExchangeInt(&Context->LastError, AL_NO_ERROR, errorCode);
44 }
45
46 AL_API ALenum AL_APIENTRY alGetError(void)
47 {
48 ALCcontext *Context;
49 ALenum errorCode;
50
51 Context = GetContextRef();
52 if(!Context)
53 {
54 if(TrapALError)
55 {
56 #ifdef _WIN32
57 if(IsDebuggerPresent())
58 DebugBreak();
59 #elif defined(SIGTRAP)
60 raise(SIGTRAP);
61 #endif
62 }
63 return AL_INVALID_OPERATION;
64 }
65
66 errorCode = ExchangeInt(&Context->LastError, AL_NO_ERROR);
67
68 ALCcontext_DecRef(Context);
69
70 return errorCode;
71 }
AL_APIENTRY
#define AL_APIENTRY
Definition: al.h:21
ALvoid
void ALvoid
Definition: al.h:74
alGetError
AL_API ALenum AL_APIENTRY alGetError(void)
Definition: alError.c:46
AL_FALSE
#define AL_FALSE
Definition: al.h:83
alError.h
GetContextRef
ALCcontext * GetContextRef(void)
Definition: ALc.c:1999
alMain.h
ALenum
int ALenum
Definition: al.h:65
AL_API
#define AL_API
Definition: al.h:14
ALCcontext_struct::LastError
ALenum LastError
Definition: alMain.h:684
ALCcontext_DecRef
void ALCcontext_DecRef(ALCcontext *context)
Definition: ALc.c:1949
ALCcontext_struct
Definition: alMain.h:675
TrapALError
ALboolean TrapALError
Definition: alError.c:29
ALboolean
char ALboolean
Definition: al.h:38
alSetError
ALvoid alSetError(ALCcontext *Context, ALenum errorCode)
Definition: alError.c:31
AL_NO_ERROR
#define AL_NO_ERROR
Definition: al.h:364
AL_INVALID_OPERATION
#define AL_INVALID_OPERATION
Definition: al.h:376