From 8444470e3a60ee8b709b850e2a33d7f3ef2c9d66 Mon Sep 17 00:00:00 2001 From: SegaraRai Date: Thu, 11 Nov 2021 03:14:19 +0900 Subject: [PATCH] use `#pragma message` instead of `#warning` for non-GCC compilers --- modules/gapi/include/opencv2/gapi/util/any.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/gapi/include/opencv2/gapi/util/any.hpp b/modules/gapi/include/opencv2/gapi/util/any.hpp index 5f97e95b08..94451c7717 100644 --- a/modules/gapi/include/opencv2/gapi/util/any.hpp +++ b/modules/gapi/include/opencv2/gapi/util/any.hpp @@ -31,7 +31,11 @@ namespace internal #if defined(__GXX_RTTI) || defined(_CPPRTTI) return dynamic_cast(operand); #else - #warning used static cast instead of dynamic because RTTI is disabled +#ifdef __GNUC__ +#warning used static cast instead of dynamic because RTTI is disabled +#else +#pragma message("WARNING: used static cast instead of dynamic because RTTI is disabled") +#endif return static_cast(operand); #endif }