]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
safe_math.h: Check if __GNUC__ is defined
authorKalavakolanu, Hema Anmisha <hema.anmisha.kalavakolanu@intel.com>
Wed, 18 Dec 2024 05:19:55 +0000 (10:49 +0530)
committerTomas Mraz <tomas@openssl.org>
Thu, 19 Dec 2024 16:45:48 +0000 (17:45 +0100)
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 <kraxel@redhat.com>
Signed-off-by: Kalavakolanu Hema Anmisha <hema.anmisha.kalavakolanu@intel.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26204)

include/internal/safe_math.h

index be37e6ab882ed746f4fa9d854337a9b002f2b3d5..ecfb281f40aab6513faeee85f2dcb065f9e6cd24 100644 (file)
 # 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 */