diff options
-rw-r--r-- | compat/defs.hpp | 8 | ||||
-rw-r--r-- | entity/metadata.hpp | 10 |
2 files changed, 13 insertions, 5 deletions
diff --git a/compat/defs.hpp b/compat/defs.hpp index 585c45d1..7fa74c9f 100644 --- a/compat/defs.hpp +++ b/compat/defs.hpp @@ -53,3 +53,11 @@ #else # define fm_noinline __attribute__((noinline)) #endif + +#ifdef _MSC_VER +// standard version not supported in MSVC v14x ABI +// see https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/ +#define fm_no_unique_address msvc::no_unique_address +#else +#define fm_no_unique_address no_unique_address +#endif diff --git a/entity/metadata.hpp b/entity/metadata.hpp index dd82ce8a..16a4422d 100644 --- a/entity/metadata.hpp +++ b/entity/metadata.hpp @@ -112,11 +112,11 @@ public: using Length = typename c_length::type; StringView name; - [[no_unique_address]] R reader; - [[no_unique_address]] W writer; - [[no_unique_address]] Predicate predicate; - [[no_unique_address]] Range range; - [[no_unique_address]] Length length; + [[fm_no_unique_address]] R reader; + [[fm_no_unique_address]] W writer; + [[fm_no_unique_address]] Predicate predicate; + [[fm_no_unique_address]] Range range; + [[fm_no_unique_address]] Length length; fm_DECLARE_DEFAULT_MOVE_COPY_ASSIGNMENTS(entity_field); |