From 11d148502d8131fdada39b4421dbfe4cf4899dd9 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 12 Jun 2022 23:20:53 -0700 Subject: Use an inline function instead of a function-like macro --- alc/alc.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'alc') diff --git a/alc/alc.cpp b/alc/alc.cpp index c51eb3c1..6ee6c24a 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1312,7 +1312,8 @@ void alc_initconfig(void) } #endif // ALSOFT_EAX } -#define DO_INITCONFIG() std::call_once(alc_config_once, [](){alc_initconfig();}) +inline void InitConfig() +{ std::call_once(alc_config_once, [](){alc_initconfig();}); } /************************************************ @@ -1320,7 +1321,7 @@ void alc_initconfig(void) ************************************************/ void ProbeAllDevicesList() { - DO_INITCONFIG(); + InitConfig(); std::lock_guard _{ListLock}; if(!PlaybackFactory) @@ -1334,7 +1335,7 @@ void ProbeAllDevicesList() } void ProbeCaptureDeviceList() { - DO_INITCONFIG(); + InitConfig(); std::lock_guard _{ListLock}; if(!CaptureFactory) @@ -3375,7 +3376,7 @@ END_API_FUNC ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) START_API_FUNC { - DO_INITCONFIG(); + InitConfig(); if(!PlaybackFactory) { @@ -3535,7 +3536,7 @@ END_API_FUNC ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, ALCuint frequency, ALCenum format, ALCsizei samples) START_API_FUNC { - DO_INITCONFIG(); + InitConfig(); if(!CaptureFactory) { @@ -3718,7 +3719,7 @@ END_API_FUNC ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName) START_API_FUNC { - DO_INITCONFIG(); + InitConfig(); /* Make sure the device name, if specified, is us. */ if(deviceName && strcmp(deviceName, alcDefaultName) != 0) -- cgit v1.2.3