From 10d782502a9f99d42b56e034d2195ee0dc5034fb Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 9 Jul 2021 21:25:13 -0700 Subject: Use variables and types when they're defined --- alc/backends/coreaudio.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'alc/backends/coreaudio.cpp') diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index e8d0320d..26b02d14 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -369,6 +369,7 @@ void CoreAudioPlayback::open(const char *name) } mAudioUnit = audioUnit; +#if CAN_ENUMERATE if(name) mDevice->DeviceName = name; else @@ -382,6 +383,9 @@ void CoreAudioPlayback::open(const char *name) if(!devname.empty()) mDevice->DeviceName = std::move(devname); else mDevice->DeviceName = "Unknown Device Name"; } +#else + mDevice->DeviceName = name; +#endif } bool CoreAudioPlayback::reset() @@ -910,11 +914,13 @@ bool CoreAudioBackendFactory::querySupport(BackendType type) std::string CoreAudioBackendFactory::probe(BackendType type) { std::string outnames; +#if CAN_ENUMERATE auto append_name = [&outnames](const DeviceEntry &entry) -> void { /* Includes null char. */ outnames.append(entry.mName.c_str(), entry.mName.length()+1); }; +#endif switch(type) { -- cgit v1.2.3