From: Kalavakolanu, Hema Anmisha Date: Wed, 18 Dec 2024 05:19:55 +0000 (+0530) Subject: safe_math.h: Check if __GNUC__ is defined X-Git-Tag: openssl-3.3.3~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96325d772b87921e6550a19c8ee7fcced727b46b;p=thirdparty%2Fopenssl.git safe_math.h: Check if __GNUC__ is defined REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4880 Facing the below issue after openssl is upgraded Edk2\CryptoPkg\Library\OpensslLib\openssl\include\internal/safe_math.h(19): warning C4668: '__GNUC__' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' CLA: trivial Reviewed-by: Gerd Hoffmann Signed-off-by: Kalavakolanu Hema Anmisha Reviewed-by: Paul Dale Reviewed-by: Tom Cosgrove Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26204) (cherry picked from commit 53b34561b56b60a812f8f65c777d469e18151e8d) --- diff --git a/include/internal/safe_math.h b/include/internal/safe_math.h index be37e6ab882..ecfb281f40a 100644 --- a/include/internal/safe_math.h +++ b/include/internal/safe_math.h @@ -16,8 +16,10 @@ # ifndef OPENSSL_NO_BUILTIN_OVERFLOW_CHECKING # ifdef __has_builtin # define has(func) __has_builtin(func) -# elif __GNUC__ > 5 -# define has(func) 1 +# elif defined(__GNUC__) +# if __GNUC__ > 5 +# define has(func) 1 +# endif # endif # endif /* OPENSSL_NO_BUILTIN_OVERFLOW_CHECKING */