aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alMain.h
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r--OpenAL32/Include/alMain.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index e92e94fb..8d766939 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -413,6 +413,18 @@ static void T##_Delete(void *ptr) { al_free(ptr); }
} while(0)
+#define EXTRACT_NEW_ARGS(...) __VA_ARGS__); \
+ } \
+} while(0)
+
+#define NEW_OBJ(_ptr, T) do { \
+ _ptr = T##_New(sizeof(*_ptr)); \
+ if(_ptr) \
+ { \
+ memset(_ptr, 0, sizeof(*_ptr)); \
+ T##_Construct(_ptr, EXTRACT_NEW_ARGS
+
+
#ifdef __cplusplus
extern "C" {
#endif