diff options
author | Chris Robinson <[email protected]> | 2023-03-01 11:35:39 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-01 11:35:39 -0800 |
commit | fde74453a62a1ce4b5efaac0ec1835b9f5731e25 (patch) | |
tree | ed74db646800b78ca8651bb5291453927f48cd93 /alc/alc.cpp | |
parent | ec9c421d312d6df701631877f6ce6256355101dc (diff) |
Use macros for the likely/unlikely attributes
The syntax parser for GCC 8 (and earlier?) fails when these attributes are in
certain places.
Diffstat (limited to 'alc/alc.cpp')
-rw-r--r-- | alc/alc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index fa230882..1a4a89ad 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -2472,7 +2472,7 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) bool ResetDeviceParams(ALCdevice *device, const int *attrList) { /* If the device was disconnected, reset it since we're opened anew. */ - if(!device->Connected.load(std::memory_order_relaxed)) [[unlikely]] + if(!device->Connected.load(std::memory_order_relaxed)) UNLIKELY { /* Make sure disconnection is finished before continuing on. */ device->waitForMix(); @@ -2504,7 +2504,7 @@ bool ResetDeviceParams(ALCdevice *device, const int *attrList) } ALCenum err{UpdateDeviceParams(device, attrList)}; - if(err == ALC_NO_ERROR) [[likely]] return ALC_TRUE; + if(err == ALC_NO_ERROR) LIKELY return ALC_TRUE; alcSetError(device, err); return ALC_FALSE; @@ -2556,7 +2556,7 @@ ContextRef GetContextRef(void) */ } context = ALCcontext::sGlobalContext.load(std::memory_order_acquire); - if(context) [[likely]] context->add_ref(); + if(context) LIKELY context->add_ref(); ALCcontext::sGlobalContextLock.store(false, std::memory_order_release); } return ContextRef{context}; |