summaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-05-20 01:32:02 -0700
committerChris Robinson <[email protected]>2013-05-20 01:32:02 -0700
commit4c436b106d1a2b57e28fcaff0d5ec4a7abc6badc (patch)
treec1aff676a030f3581a28bfcb65a286c9910aaaa5 /OpenAL32/Include
parent1c523df16044730986ec745170d724fa82015ea0 (diff)
Use some macros to help with deriving types
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h4
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