From 55f0eb1b77c1c1bfc387927bad06210257f50f21 Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Sat, 4 Dec 2021 09:00:47 +0300 Subject: [PATCH] MSVC: Ifdef GCC pragmas Error message: test_ciphers.c(37,9): warning C4068: unknown pragma 'GCC' Signed-off-by: Vitaly Chikunov --- test_ciphers.c | 4 +++- test_digest.c | 4 +++- test_tls.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) 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); \ -- 2.39.2