diff --git a/src/C4Attributes.h b/src/C4Attributes.h index b869ca9f2..75c99082e 100644 --- a/src/C4Attributes.h +++ b/src/C4Attributes.h @@ -16,5 +16,7 @@ #pragma once #if __has_cpp_attribute(msvc::no_unique_address) -#define no_unique_address msvc::no_unique_address +#define NO_UNIQUE_ADDRESS msvc::no_unique_address +#else +#define NO_UNIQUE_ADDRESS no_unique_address #endif diff --git a/src/C4Coroutine.h b/src/C4Coroutine.h index 2597670f1..eef3fe8b7 100644 --- a/src/C4Coroutine.h +++ b/src/C4Coroutine.h @@ -56,7 +56,7 @@ class CancelledException : public std::exception template struct ValueWrapper { - [[no_unique_address]] U Value; + [[NO_UNIQUE_ADDRESS]] U Value; U &&GetValue() { return static_cast(Value); } }; diff --git a/src/C4CurlSystem.h b/src/C4CurlSystem.h index d8cd6266f..10507df05 100644 --- a/src/C4CurlSystem.h +++ b/src/C4CurlSystem.h @@ -200,7 +200,7 @@ class C4CurlSystem private: std::atomic_uint32_t timeout{StdSync::Infinite}; - [[no_unique_address]] GlobalInit globalInit; + [[NO_UNIQUE_ADDRESS]] GlobalInit globalInit; MultiHandle multiHandle;