@@ -137,7 +137,6 @@ extern int KARATSUBA_MUL_CUTOFF,
137
137
138
138
/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */
139
139
#define _MP_WARRAY_PRIVATE (1u << (((CHAR_BIT * sizeof(mp_word)) - (2 * MP_DIGIT_BIT)) + 1))
140
- #define MP_WARRAY (MP_DEPRECATED_PRAGMA("MP_WARRAY is an internal macro") _MP_WARRAY_PRIVATE)
141
140
142
141
/* the infamous mp_int structure */
143
142
typedef struct {
@@ -148,23 +147,31 @@ typedef struct {
148
147
/* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */
149
148
typedef int ltm_prime_callback (unsigned char * dst , int len , void * dat );
150
149
151
- #if defined(__GNUC__ ) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301 )
152
- # define MP_DEPRECATED (x ) __attribute__((deprecated("replaced by " #x)))
153
- # define _MP_DEPRECATED_PRAGMA (s ) _Pragma(#s)
154
- # define MP_DEPRECATED_PRAGMA (s ) _MP_DEPRECATED_PRAGMA(GCC warning s)
155
- #elif defined(_MSC_VER ) && _MSC_VER >= 1500
156
- # define MP_DEPRECATED (x ) __declspec(deprecated("replaced by " #x))
157
- # define MP_DEPRECATED_PRAGMA (s ) __pragma(message(s))
158
- #else
159
- # define MP_DEPRECATED
160
- # define MP_DEPRECATED_PRAGMA (s )
150
+ #ifndef MP_NO_DEPRECATED
151
+
152
+ # ifndef _MP_NO_DEPRECATED_WARNING
153
+ # warning Deprecated functions are enabled, define MP_NO_DEPRECATED!
154
+ # endif
155
+
156
+ # if defined(__GNUC__ ) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301 )
157
+ # define MP_DEPRECATED (x ) __attribute__((deprecated("replaced by " #x)))
158
+ # define _MP_DEPRECATED_PRAGMA (s ) _Pragma(#s)
159
+ # define MP_DEPRECATED_PRAGMA (s ) _MP_DEPRECATED_PRAGMA(GCC warning s)
160
+ # elif defined(_MSC_VER ) && _MSC_VER >= 1500
161
+ # define MP_DEPRECATED (x ) __declspec(deprecated("replaced by " #x))
162
+ # define MP_DEPRECATED_PRAGMA (s ) __pragma(message(s))
163
+ # else
164
+ # define MP_DEPRECATED
165
+ # define MP_DEPRECATED_PRAGMA (s )
166
+ # endif
167
+
168
+ # define DIGIT_BIT MP_DIGIT_BIT
169
+ # define USED (m ) (MP_DEPRECATED_PRAGMA("USED macro is deprecated, use z->used instead") (m)->used)
170
+ # define DIGIT (m , k ) (MP_DEPRECATED_PRAGMA("DIGIT macro is deprecated, use z->dp instead") (m)->dp[(k)])
171
+ # define SIGN (m ) (MP_DEPRECATED_PRAGMA("SIGN macro is deprecated, use z->sign instead") (m)->sign)
172
+ # define MP_WARRAY (MP_DEPRECATED_PRAGMA("MP_WARRAY is an internal macro") _MP_WARRAY_PRIVATE)
161
173
#endif
162
174
163
- #define DIGIT_BIT (MP_DEPRECATED_PRAGMA("DIGIT_BIT macro is deprecated, MP_DIGIT_BIT instead") MP_DIGIT_BIT)
164
- #define USED (m ) (MP_DEPRECATED_PRAGMA("USED macro is deprecated, use z->used instead") (m)->used)
165
- #define DIGIT (m , k ) (MP_DEPRECATED_PRAGMA("DIGIT macro is deprecated, use z->dp instead") (m)->dp[(k)])
166
- #define SIGN (m ) (MP_DEPRECATED_PRAGMA("SIGN macro is deprecated, use z->sign instead") (m)->sign)
167
-
168
175
/* error code to char* string */
169
176
const char * mp_error_to_string (int code );
170
177
0 commit comments