diff --git a/Source/cpp.hint b/Source/cpp.hint new file mode 100644 index 000000000..dd5e956b9 --- /dev/null +++ b/Source/cpp.hint @@ -0,0 +1,7 @@ +// Hint files help the Visual Studio IDE interpret Visual C++ identifiers +// such as names of functions and macros. +// For more information see https://go.microsoft.com/fwlink/?linkid=865984 +#define DVL_ALWAYS_INLINE +#define DVL_ATTRIBUTE_HOT +#define DVL_API_FOR_TEST +#define DVL_REINITIALIZES diff --git a/Source/items.h b/Source/items.h index 15b5f9039..357c5889f 100644 --- a/Source/items.h +++ b/Source/items.h @@ -245,7 +245,7 @@ struct Item { /** * @brief Resets the item so isEmpty() returns true without needing to reinitialise the whole object */ - void Clear() + DVL_REINITIALIZES void Clear() { this->_itype = ItemType::None; } diff --git a/Source/utils/attributes.h b/Source/utils/attributes.h index 163545791..16214fd0d 100644 --- a/Source/utils/attributes.h +++ b/Source/utils/attributes.h @@ -42,3 +42,11 @@ #else #define DVL_API_FOR_TEST #endif + +#if defined(__clang__) +#define DVL_REINITIALIZES [[clang::reinitializes]] +#elif DVL_HAVE_ATTRIBUTE(reinitializes) +#define DVL_REINITIALIZES __attribute__((reinitializes)) +#else +#define DVL_REINITIALIZES +#endif