From 681973dcdcb29a09d67984fc5d60fef6e41ea2b7 Mon Sep 17 00:00:00 2001 From: Eugene Golushkov Date: Fri, 20 Sep 2024 18:32:52 +0200 Subject: [PATCH] OGRE_FALLTHROUGH for MSVC --- OgreMain/include/OgrePrerequisites.h | 2 +- RenderSystems/Direct3D11/src/OgreD3D11Device.cpp | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/OgreMain/include/OgrePrerequisites.h b/OgreMain/include/OgrePrerequisites.h index d858a0fd5dc..29fea2e0750 100644 --- a/OgreMain/include/OgrePrerequisites.h +++ b/OgreMain/include/OgrePrerequisites.h @@ -82,7 +82,7 @@ namespace Ogre #define OGRE_UNUSED_VAR( x ) ( (void)x ) -#if __cplusplus >= 201703L +#if __cplusplus >= 201703L || defined( _MSVC_LANG ) && _MSVC_LANG >= 201703L # define OGRE_FALLTHROUGH [[fallthrough]] #else # if OGRE_COMPILER == OGRE_COMPILER_CLANG diff --git a/RenderSystems/Direct3D11/src/OgreD3D11Device.cpp b/RenderSystems/Direct3D11/src/OgreD3D11Device.cpp index d824c88c6ab..b246b942714 100644 --- a/RenderSystems/Direct3D11/src/OgreD3D11Device.cpp +++ b/RenderSystems/Direct3D11/src/OgreD3D11Device.cpp @@ -224,13 +224,8 @@ namespace Ogre char tmp[64]; sprintf( tmp, "deviceRemovedReason = 0x%08X\n", (unsigned)deviceRemovedReason ); res.append( tmp ); + OGRE_FALLTHROUGH; } - // No 'break', fallthrough to the next switch statement -#if OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG - __attribute__( ( fallthrough ) ); -#elif __cplusplus >= 201703L - [[fallthrough]]; -#endif default: { char tmp[64];