From ad0d39efed503b8144dd2db72f467dc22b508ab7 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sun, 13 Nov 2022 10:41:59 +0800 Subject: [PATCH] glsl: Use DETECT_CC_GCC_VERSION in glsl/builtin_functions.cpp The expression "(__GNUC__ * 100) + __GNUC_MINOR" is invalid because __GNUC_MINOR is not defined by the compiler This can not fixes the previous version because DETECT_CC_GCC_VERSION is not available in previous released version Signed-off-by: Yonggang Luo Reviewed-by: Erik Faye-Lund Part-of: --- src/compiler/glsl/builtin_functions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index 0fed479..e07ac61 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -67,7 +67,9 @@ * MinGW 7.3.0 (in Ubuntu 18.04) does not have this bug. Assume versions before 7.3.x are buggy */ -#if defined(__MINGW32__) && ((__GNUC__ * 100) + __GNUC_MINOR < 703) +#include "util/detect_cc.h" + +#if defined(__MINGW32__) && (DETECT_CC_GCC_VERSION < 703) #warning "disabling optimizations for this file to work around compiler bug" #pragma GCC optimize("O1") #endif -- 2.7.4