From: Vitaly Chikunov Date: Sat, 4 Dec 2021 06:55:55 +0000 (+0300) Subject: MSVC: No support for GCC's compound statement expressions X-Git-Tag: v3.0.1~26 X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=openssl-gost%2Fengine.git;a=commitdiff_plain;h=a0d13491d28ee12e1c5517a0684a571be96fc7a5 MSVC: No support for GCC's compound statement expressions Error messages: test_ciphers.c(329,5): error C2059: syntax error: '{' test_ciphers.c(329,5): error C2059: syntax error: '}' test_ciphers.c(329,5): error C2059: syntax error: ')' Signed-off-by: Vitaly Chikunov --- diff --git a/test_ciphers.c b/test_ciphers.c index ddf572d..2e923a7 100644 --- a/test_ciphers.c +++ b/test_ciphers.c @@ -21,12 +21,11 @@ #endif #include -#define T(e) ({ \ - if (!(e)) {\ - ERR_print_errors_fp(stderr);\ - OpenSSLDie(__FILE__, __LINE__, #e);\ - } \ -}) +#define T(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + OpenSSLDie(__FILE__, __LINE__, #e); \ + } #define cRED "\033[1;31m" #define cDRED "\033[0;31m" diff --git a/test_context.c b/test_context.c index fa0d2fa..293f921 100644 --- a/test_context.c +++ b/test_context.c @@ -15,9 +15,10 @@ # include "gost_lcl.h" #endif -#define T(e) if (!(e)) {\ - ERR_print_errors_fp(stderr);\ - OpenSSLDie(__FILE__, __LINE__, #e);\ +#define T(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + OpenSSLDie(__FILE__, __LINE__, #e); \ } #define cRED "\033[1;31m" diff --git a/test_curves.c b/test_curves.c index 73c47d9..344a50e 100644 --- a/test_curves.c +++ b/test_curves.c @@ -15,11 +15,11 @@ #include #include -#define T(e) ({ if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - OpenSSLDie(__FILE__, __LINE__, #e); \ - } \ - }) +#define T(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + OpenSSLDie(__FILE__, __LINE__, #e); \ + } #define cRED "\033[1;31m" #define cDRED "\033[0;31m" diff --git a/test_derive.c b/test_derive.c index c99ccef..09b01ac 100644 --- a/test_derive.c +++ b/test_derive.c @@ -15,12 +15,11 @@ #include #include "gost_lcl.h" -#define T(e) ({ \ +#define T(e) \ if (!(e)) { \ ERR_print_errors_fp(stderr); \ OpenSSLDie(__FILE__, __LINE__, #e); \ - } \ -}) + } #define cRED "\033[1;31m" #define cDRED "\033[0;31m" diff --git a/test_digest.c b/test_digest.c index a931a35..f3d4169 100644 --- a/test_digest.c +++ b/test_digest.c @@ -29,17 +29,17 @@ #endif /* Helpers to test OpenSSL API calls. */ -#define T(e) ({ if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - OpenSSLDie(__FILE__, __LINE__, #e); \ - } \ - }) -#define TE(e) ({ if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \ - return -1; \ - } \ - }) +#define T(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + OpenSSLDie(__FILE__, __LINE__, #e); \ + } +#define TE(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \ + return -1; \ + } #define cRED "\033[1;31m" #define cDRED "\033[0;31m" diff --git a/test_keyexpimp.c b/test_keyexpimp.c index 7c40927..d7e0e09 100644 --- a/test_keyexpimp.c +++ b/test_keyexpimp.c @@ -15,9 +15,10 @@ #include "e_gost_err.h" #include "gost_grasshopper_cipher.h" -#define T(e) if (!(e)) {\ - ERR_print_errors_fp(stderr);\ - OpenSSLDie(__FILE__, __LINE__, #e);\ +#define T(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + OpenSSLDie(__FILE__, __LINE__, #e); \ } static void hexdump(FILE *f, const char *title, const unsigned char *s, int l) diff --git a/test_params.c b/test_params.c index 89bae3d..2808e26 100644 --- a/test_params.c +++ b/test_params.c @@ -19,17 +19,17 @@ #include #include -#define T(e) ({ if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - OpenSSLDie(__FILE__, __LINE__, #e); \ - } \ - }) -#define TE(e) ({ if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \ - return -1; \ - } \ - }) +#define T(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + OpenSSLDie(__FILE__, __LINE__, #e); \ + } +#define TE(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \ + return -1; \ + } #define cRED "\033[1;31m" #define cDRED "\033[0;31m" diff --git a/test_sign.c b/test_sign.c index 0322ac0..4dd5d9b 100644 --- a/test_sign.c +++ b/test_sign.c @@ -20,17 +20,17 @@ #include #include -#define T(e) ({ if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - OpenSSLDie(__FILE__, __LINE__, #e); \ - } \ - }) -#define TE(e) ({ if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \ - return -1; \ - } \ - }) +#define T(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + OpenSSLDie(__FILE__, __LINE__, #e); \ + } +#define TE(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \ + return -1; \ + } #define cRED "\033[1;31m" #define cDRED "\033[0;31m" diff --git a/test_tls.c b/test_tls.c index b1d0865..d016e62 100644 --- a/test_tls.c +++ b/test_tls.c @@ -35,17 +35,17 @@ # pragma GCC diagnostic ignored "-Wpointer-sign" #endif -#define T(e) ({ if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - OpenSSLDie(__FILE__, __LINE__, #e); \ - } \ - }) -#define TE(e) ({ if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \ - return -1; \ - } \ - }) +#define T(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + OpenSSLDie(__FILE__, __LINE__, #e); \ + } +#define TE(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \ + return -1; \ + } #define cRED "\033[1;31m" #define cDRED "\033[0;31m"