From 41b9d473a2753fea2deeb1f1f8f241fd53270c3d Mon Sep 17 00:00:00 2001 From: Minmin Gong Date: Mon, 4 Feb 2019 19:59:19 -0800 Subject: Fix compiling problems on VS2019 with vc142 toolset Msvc142 in VS2019 preview 2 doesn't allow std::atomic_flag to be initialized by a bool. Call test_and_set in the constructors instead. --- Alc/alc.cpp | 1 + Alc/alcontext.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'Alc') diff --git a/Alc/alc.cpp b/Alc/alc.cpp index d05d1431..425af2da 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2312,6 +2312,7 @@ static DeviceRef VerifyDevice(ALCdevice *device) ALCcontext::ALCcontext(ALCdevice *device) : Device{device} { + PropsClean.test_and_set(); } /* InitContext diff --git a/Alc/alcontext.h b/Alc/alcontext.h index 472d06ae..213949f2 100644 --- a/Alc/alcontext.h +++ b/Alc/alcontext.h @@ -80,7 +80,7 @@ struct ALCcontext { ALfloat SpeedOfSound{}; ALfloat MetersPerUnit{1.0f}; - std::atomic_flag PropsClean{true}; + std::atomic_flag PropsClean; std::atomic DeferUpdates{false}; std::mutex PropLock; -- cgit v1.2.3