Skip to content

Commit 2f03417

Browse files
committed
Allow deprecation warnings to be disabled
One can now define them on a per-case basis to disable them. Signed-off-by: Steffen Jaeckel <[email protected]>
1 parent a4ce990 commit 2f03417

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/headers/tomcrypt_cfg.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,21 +329,30 @@ typedef unsigned long ltc_mp_digit;
329329
# define LTC_NULL_TERMINATED
330330
#endif
331331

332+
#ifndef LTC_DEPRECATED
332333
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
333334
# define LTC_DEPRECATED(s) __attribute__((deprecated("replaced by " #s)))
334-
# define PRIVATE_LTC_DEPRECATED_PRAGMA(s) _Pragma(#s)
335-
# define LTC_DEPRECATED_PRAGMA(s) PRIVATE_LTC_DEPRECATED_PRAGMA(GCC warning s)
336335
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
337336
# define LTC_DEPRECATED(s) __attribute__((deprecated))
338-
# define LTC_DEPRECATED_PRAGMA(s)
339337
#elif defined(_MSC_VER) && _MSC_VER >= 1500
340338
/* supported since Visual Studio 2008 */
341339
# define LTC_DEPRECATED(s) __declspec(deprecated("replaced by " #s))
342-
# define LTC_DEPRECATED_PRAGMA(s) __pragma(message(s))
343340
#else
344341
# define LTC_DEPRECATED(s)
342+
#endif
343+
#endif
344+
345+
#ifndef LTC_DEPRECATED_PRAGMA
346+
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
347+
# define PRIVATE_LTC_DEPRECATED_PRAGMA(s) _Pragma(#s)
348+
# define LTC_DEPRECATED_PRAGMA(s) PRIVATE_LTC_DEPRECATED_PRAGMA(GCC warning s)
349+
#elif defined(_MSC_VER) && _MSC_VER >= 1500
350+
/* supported since Visual Studio 2008 */
351+
# define LTC_DEPRECATED_PRAGMA(s) __pragma(message(s))
352+
#else
345353
# define LTC_DEPRECATED_PRAGMA(s)
346354
#endif
355+
#endif
347356

348357
#if defined(__GNUC__) || defined(__clang__)
349358
# define LTC_ATTRIBUTE(x) __attribute__(x)

0 commit comments

Comments
 (0)