aboutsummaryrefslogtreecommitdiffstats
path: root/al/error.h
blob: 6408b60c0b94c18dac83195c4395b3174d565195 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef AL_ERROR_H
#define AL_ERROR_H

#include "AL/al.h"
#include "AL/alc.h"

#include "logging.h"


extern bool TrapALError;

void alSetError(ALCcontext *context, ALenum errorCode, const char *msg, ...) DECL_FORMAT(printf, 3, 4);

#define SETERR_GOTO(ctx, err, lbl, ...) do {                                   \
    alSetError((ctx), (err), __VA_ARGS__);                                     \
    goto lbl;                                                                  \
} while(0)

#define SETERR_RETURN(ctx, err, retval, ...) do {                              \
    alSetError((ctx), (err), __VA_ARGS__);                                     \
    return retval;                                                             \
} while(0)

#endif