fix gcc version check for deprecations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/bn_prime_tab.c b/bn_prime_tab.c
index 008e9c3..a6c07f8 100644
--- a/bn_prime_tab.c
+++ b/bn_prime_tab.c
@@ -44,7 +44,7 @@ const mp_digit ltm_prime_tab[] = {
#endif
};
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
+#if defined(__GNUC__) && __GNUC__ >= 4
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
const mp_digit *s_mp_prime_tab = ltm_prime_tab;
diff --git a/tommath.h b/tommath.h
index 1c00ade..8efb9f9 100644
--- a/tommath.h
+++ b/tommath.h
@@ -206,7 +206,7 @@ TOOM_SQR_CUTOFF;
# endif
#endif
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
# define MP_DEPRECATED(x) __attribute__((deprecated("replaced by " #x)))
# define PRIVATE_MP_DEPRECATED_PRAGMA(s) _Pragma(#s)
# define MP_DEPRECATED_PRAGMA(s) PRIVATE_MP_DEPRECATED_PRAGMA(GCC warning s)
diff --git a/tommath_private.h b/tommath_private.h
index 8e89561..4c25fa0 100644
--- a/tommath_private.h
+++ b/tommath_private.h
@@ -17,7 +17,7 @@
*
* On Win32 a .def file must be used to specify the exported symbols.
*/
-#if defined (MP_PRIVATE_SYMBOLS) && __GNUC__ >= 4
+#if defined (MP_PRIVATE_SYMBOLS) && defined(__GNUC__) && __GNUC__ >= 4
# define MP_PRIVATE __attribute__ ((visibility ("hidden")))
#else
# define MP_PRIVATE