Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(wwlib): initialise atomic_flag where apple clang 15 accepts it

Olcay Seygane5c31f6bc362
diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/mutex.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/mutex.h
index dabdff924..ce864ffcb 100644
--- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/mutex.h
+++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/mutex.h
@@ -189,10 +189,10 @@ public:
*/
class FastCriticalSectionClass
{
- std::atomic_flag Flag;
+ std::atomic_flag Flag = ATOMIC_FLAG_INIT;
public:
- FastCriticalSectionClass() : Flag ATOMIC_FLAG_INIT {}
+ FastCriticalSectionClass() {}
class LockClass
{
diff --git a/GeneralsMD/Code/Libraries/Source/profile/internal.h b/GeneralsMD/Code/Libraries/Source/profile/internal.h
index 7f4b2a17e..c3324a25c 100644
--- a/GeneralsMD/Code/Libraries/Source/profile/internal.h
+++ b/GeneralsMD/Code/Libraries/Source/profile/internal.h
@@ -49,7 +49,7 @@ class ProfileFastCS
ProfileFastCS(const ProfileFastCS&);
ProfileFastCS& operator=(const ProfileFastCS&);
- std::atomic_flag m_Flag;
+ std::atomic_flag m_Flag = ATOMIC_FLAG_INIT;
/* The third copy of WWLib's "lock bts" spin (B14 did all three in one commit; the other two
are WWLib/mutex.h and WWDebug/wwmemlog.cpp). std::atomic_flag now, for the same reasons
@@ -74,8 +74,7 @@ class ProfileFastCS
}
public:
- ProfileFastCS(void):
- m_Flag ATOMIC_FLAG_INIT
+ ProfileFastCS(void)
{
}