From 8808159d55a65cec92010622f63844e76644722c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 26 May 2013 00:01:07 -0700 Subject: Add helper macros to set an error and return, and use it in a few places --- OpenAL32/Include/alError.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenAL32/Include') 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 -- cgit v1.2.3