From 67cbaa5a02e37d7cb2388adda72dd31451b3620f Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 12 Nov 2016 14:52:58 +0000 Subject: [PATCH] [PSEH3] - Avoid trying to disable 'declaration after statement' warnings in C++ CORE-11794 svn path=/trunk/; revision=73211 --- reactos/sdk/include/reactos/libs/pseh/pseh3.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/reactos/sdk/include/reactos/libs/pseh/pseh3.h b/reactos/sdk/include/reactos/libs/pseh/pseh3.h index 7473a8c0f57..6f9732ed728 100644 --- a/reactos/sdk/include/reactos/libs/pseh/pseh3.h +++ b/reactos/sdk/include/reactos/libs/pseh/pseh3.h @@ -16,6 +16,12 @@ extern "C" { #endif +#ifdef __cplusplus +#define PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT +#else +#define PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT _Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"") +#endif + /* CLANG must safe non-volatiles, because it uses a return-twice algorithm */ #if defined(__clang__) && !defined(_SEH3$_FRAME_ALL_NONVOLATILES) #define _SEH3$_FRAME_ALL_NONVOLATILES 1 @@ -354,7 +360,7 @@ _Pragma("GCC diagnostic pop") \ (void)&&_SEH3$_l_FilterOrFinally; \ \ _Pragma("GCC diagnostic push") \ -_Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \ +PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT \ \ /* Count the try level. Outside of any __try, _SEH3$_TryLevel is 0 */ \ enum { \ @@ -386,7 +392,7 @@ _Pragma("GCC diagnostic pop") \ _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ \ _Pragma("GCC diagnostic push") \ -_Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \ +PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT \ \ /* Forward declaration of the filter function */ \ _SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FilterFunction); \ @@ -436,7 +442,7 @@ _Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \ _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ \ _Pragma("GCC diagnostic push") \ -_Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \ +PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT \ \ /* Forward declaration of the finally function */ \ _SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FinallyFunction); \