aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-05-26 00:01:07 -0700
committerChris Robinson <[email protected]>2013-05-26 00:01:07 -0700
commit8808159d55a65cec92010622f63844e76644722c (patch)
tree7efadd52692b8558e1da4c476c3f63632e60d974 /OpenAL32
parent2759239754c4e9b7ff3f6d8a267c6a208dae48ed (diff)
Add helper macros to set an error and return, and use it in a few places
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alError.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/OpenAL32/Include/alError.h b/OpenAL32/Include/alError.h
index 0ade342d..b6186054 100644
--- a/OpenAL32/Include/alError.h
+++ b/OpenAL32/Include/alError.h
@@ -11,6 +11,16 @@ extern ALboolean TrapALError;
ALvoid alSetError(ALCcontext *Context, ALenum errorCode);
+#define SET_ERROR_AND_RETURN(ctx, err) do { \
+ alSetError((ctx), (err)); \
+ return; \
+} while(0)
+
+#define SET_AND_RETURN_ERROR(ctx, err) do { \
+ alSetError((ctx), (err)); \
+ return (err); \
+} while(0)
+
#ifdef __cplusplus
}
#endif