diff options
author | Chris Robinson <[email protected]> | 2013-05-20 01:32:02 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-20 01:32:02 -0700 |
commit | 4c436b106d1a2b57e28fcaff0d5ec4a7abc6badc (patch) | |
tree | c1aff676a030f3581a28bfcb65a286c9910aaaa5 /OpenAL32 | |
parent | 1c523df16044730986ec745170d724fa82015ea0 (diff) |
Use some macros to help with deriving types
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index d234ae13..a1a90b2f 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -62,6 +62,10 @@ static const union { #define COUNTOF(x) (sizeof((x))/sizeof((x)[0])) +#define DERIVE_FROM_TYPE(t) t t##_parent +#define GET_DERIVED_TYPE(t, o) (&(o)->t##_parent) +#define GET_PARENT_TYPE(t1, t2, o) ((t1*)((char*)(o) - offsetof(t1, t2##_parent))) + #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN |