From 7d12eb4a511603e5b1ce3f644b9460dd1c29d436 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 28 Sep 2017 18:47:33 +0200 Subject: [PATCH] (WASAPI) Compiles now as C++ as well as C --- audio/drivers/wasapi.c | 13 +++++++++++-- menu/menu_animation.c | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/audio/drivers/wasapi.c b/audio/drivers/wasapi.c index 97c0f67ded..328cd282ed 100644 --- a/audio/drivers/wasapi.c +++ b/audio/drivers/wasapi.c @@ -64,12 +64,21 @@ DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0 wasapi_sys_err(fun_str);\ err_exp; } -#define WASAPI_RELEASE(iface)\ +#ifdef __cplusplus +#define WASAPI_RELEASE(iface) \ + if(iface) \ + { \ + iface->Release();\ + iface = NULL; \ + } +#else +#define WASAPI_RELEASE(iface) \ if(iface) \ { \ iface->lpVtbl->Release(iface);\ iface = NULL; \ - } \ + } +#endif #define WASAPI_FREE(ptr)\ if(ptr) {\ diff --git a/menu/menu_animation.c b/menu/menu_animation.c index ce6cfa17dc..63da135b05 100644 --- a/menu/menu_animation.c +++ b/menu/menu_animation.c @@ -19,6 +19,7 @@ #include #include +#include #include #include