From 7b11ce3dd290b2f34164074cc493ea9e0c197fdf Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 9 Jun 2018 12:00:34 -0400 Subject: [PATCH] Compiler: Use [[maybe_unused]] in the Windows DOLPHIN_UNUSED macro The required version of MSVC already supports [[maybe_unused]], so we can utilize this here. When GCC 7 and clang 3.9 become hard requirements, we can eliminate this macro entirely and replace it with [[maybe_unused]]. --- Source/Core/Common/Compiler.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/Compiler.h b/Source/Core/Common/Compiler.h index 194aae90ce..0cd3836330 100644 --- a/Source/Core/Common/Compiler.h +++ b/Source/Core/Common/Compiler.h @@ -4,12 +4,13 @@ #pragma once +// TODO: Replace this with [[maybe_unused]] directly when GCC 7 and clang 3.9 +// are hard requirements. #if defined(__GNUC__) || __clang__ // Disable "unused function" warnings for the ones manually marked as such. #define DOLPHIN_UNUSED __attribute__((unused)) #else -// Not sure MSVC even checks this... -#define DOLPHIN_UNUSED +#define DOLPHIN_UNUSED [[maybe_unused]] #endif #ifdef _WIN32