[ruby/digest] Suppress md5 deprecation warnings by gcc as well as clang

https://github.com/ruby/digest/commit/76878e3201
This commit is contained in:
Nobuyoshi Nakada 2024-08-01 00:26:20 +09:00 коммит произвёл git
Родитель 0e7b6e348f
Коммит 7387a09791
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -1,8 +1,16 @@
#define COMMON_DIGEST_FOR_OPENSSL 1
#include <CommonCrypto/CommonDigest.h>
#ifdef __clang__
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
#ifdef __GNUC__
# define RB_DIGEST_DIAGNOSTIC(compiler, op, flag) _Pragma(STRINGIZE(compiler diagnostic op flag))
# ifdef RBIMPL_WARNING_IGNORED
# define RB_DIGEST_WARNING_IGNORED(flag) RBIMPL_WARNING_IGNORED(flag)
# elif defined(__clang__)
# define RB_DIGEST_WARNING_IGNORED(flag) RB_DIGEST_DIAGNOSTIC(clang, ignored, #flag)
# else /* __GNUC__ */
# define RB_DIGEST_WARNING_IGNORED(flag) RB_DIGEST_DIAGNOSTIC(GCC, ignored, #flag)
# endif
RB_DIGEST_WARNING_IGNORED(-Wdeprecated-declarations)
/* Suppress deprecation warnings of MD5 from Xcode 11.1 */
/* Although we know MD5 is deprecated too, provide just for backward
* compatibility, as well as Apple does. */