From: Vitaly Chikunov Date: Sat, 4 Dec 2021 06:00:47 +0000 (+0300) Subject: MSVC: Ifdef GCC pragmas X-Git-Tag: v3.0.1~28 X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=openssl-gost%2Fengine.git;a=commitdiff_plain;h=55f0eb1b77c1c1bfc387927bad06210257f50f21 MSVC: Ifdef GCC pragmas Error message: test_ciphers.c(37,9): warning C4068: unknown pragma 'GCC' Signed-off-by: Vitaly Chikunov --- diff --git a/test_ciphers.c b/test_ciphers.c index 86f336e..8497652 100644 --- a/test_ciphers.c +++ b/test_ciphers.c @@ -33,8 +33,10 @@ else \ printf(cGREEN "Test passed" cNORM "\n");} +#ifdef __GNUC__ /* Pragma to allow commenting out some tests. */ -#pragma GCC diagnostic ignored "-Wunused-const-variable" +# pragma GCC diagnostic ignored "-Wunused-const-variable" +#endif /* * Test keys from both GOST R 34.12-2015 and GOST R 34.13-2015, diff --git a/test_digest.c b/test_digest.c index b9c4881..a931a35 100644 --- a/test_digest.c +++ b/test_digest.c @@ -54,8 +54,10 @@ else \ printf(cGREEN " Test passed" cNORM "\n");} +#ifdef __GNUC__ /* To test older APIs. */ -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif /* * Test keys from both GOST R 34.12-2015 and GOST R 34.13-2015, diff --git a/test_tls.c b/test_tls.c index a6ac41e..b1d0865 100644 --- a/test_tls.c +++ b/test_tls.c @@ -30,8 +30,10 @@ #include #include +#ifdef __GNUC__ /* For X509_NAME_add_entry_by_txt */ -#pragma GCC diagnostic ignored "-Wpointer-sign" +# pragma GCC diagnostic ignored "-Wpointer-sign" +#endif #define T(e) ({ if (!(e)) { \ ERR_print_errors_fp(stderr); \