Clarify disabling of warnings for unused function (#7617)

This commit is contained in:
Hielke Morsink 2018-06-02 22:30:41 +02:00 committed by Michał Janiszewski
parent debb6cd46c
commit 7aada25ed2
1 changed files with 5 additions and 2 deletions

View File

@ -39,10 +39,13 @@ static uint32 _allocatedImageCount;
#ifdef DEBUG
static std::list<ImageList> _allocatedLists;
// MSVC's compiler doesn't support the [[maybe_unused]] attribute for unused static functions. Until this has been resolved, we
// need to explicitly tell the compiler to temporarily disable the warning.
// See discussion at https://github.com/OpenRCT2/OpenRCT2/pull/7617
#pragma warning(push)
#pragma warning(disable : 4505)
#pragma warning(disable : 4505) // unreferenced local function has been removed
static bool AllocatedListContains(uint32 baseImageId, uint32 count)
[[maybe_unused]] static bool AllocatedListContains(uint32 baseImageId, uint32 count)
{
bool contains = std::any_of(
_allocatedLists.begin(),