Commit 625defdcfff724f746a8d0b5f6dde42bc2d7a556

Daniel Mendler 2019-05-31T11:31:53

fix gcc version check for deprecations

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