alError.h 995 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef _AL_ERROR_H_
  2. #define _AL_ERROR_H_
  3. #include "alMain.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. extern ALboolean TrapALError;
  8. ALvoid alSetError(ALCcontext *Context, ALenum errorCode);
  9. #define SET_ERROR_AND_RETURN(ctx, err) do { \
  10. alSetError((ctx), (err)); \
  11. return; \
  12. } while(0)
  13. #define SET_ERROR_AND_RETURN_VALUE(ctx, err, val) do { \
  14. alSetError((ctx), (err)); \
  15. return (val); \
  16. } while(0)
  17. #define SET_ERROR_AND_GOTO(ctx, err, lbl) do { \
  18. alSetError((ctx), (err)); \
  19. goto lbl; \
  20. } while(0)
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. #endif