diff options
author | Chris Robinson <[email protected]> | 2013-05-27 11:48:29 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-27 11:48:29 -0700 |
commit | 9e84f38a46f49230bf836e8a33b0637c000d659b (patch) | |
tree | 733ee48b1c03794731ff1e0f2454b0db52886e5c /OpenAL32/Include/alMain.h | |
parent | 06c8442af67fcb38241d2f13a649fc8d4dedaa85 (diff) |
Use generic VCALL[_NOARGS] macros instead of type-specific wrappers
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r-- | OpenAL32/Include/alMain.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index a7c79b2a..16df2330 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -70,9 +70,17 @@ static const union { #define SET_VTABLE1(T1, obj) ((obj)->vtbl = &(T1##_vtable)) #define SET_VTABLE2(T1, T2, obj) SET_VTABLE1(T1##_##T2, STATIC_CAST(T2, (obj))) +/* Helper to extract an argument list for VCALL. Not used directly. */ +#define EXTRACT_VCALL_ARGS(...) __VA_ARGS__ + +/* Call a "virtual" method on an object, with arguments. */ +#define VCALL(obj, func, args) (((obj)->vtbl->func)((obj), EXTRACT_VCALL_ARGS args)) +/* Call a "virtual" method on an object, with no arguments. */ +#define VCALL_NOARGS(obj, func) (((obj)->vtbl->func)((obj))) + #define DELETE_OBJ(obj) do { \ - (obj)->vtbl->Destruct((obj)); \ - (obj)->vtbl->Delete((obj)); \ + VCALL_NOARGS((obj),Destruct); \ + VCALL_NOARGS((obj),Delete); \ } while(0) |