From 34dbff392d06471bd4d57395ad16b770e505e2a3 Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Fri, 3 Dec 2021 12:06:25 +0300 Subject: [PATCH] MSVC: Fix Elvis operator Error example: gost_md.c(54,45): error C2059: syntax error: ':' gost_md.c(67,5): error C2059: syntax error: 'if' gost_md.c(69,6): error C2143: syntax error: missing '{' before '->' gost_md.c(69,6): error C2059: syntax error: '->' gost_md.c(70,5): error C2059: syntax error: 'return' gost_md.c(71,1): error C2059: syntax error: '}' Signed-off-by: Vitaly Chikunov --- gost_crypt.c | 2 +- gost_md.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gost_crypt.c b/gost_crypt.c index da78e39..8f8e0d3 100644 --- a/gost_crypt.c +++ b/gost_crypt.c @@ -74,7 +74,7 @@ static int magma_cipher_ctl_acpkm_omac(EVP_CIPHER_CTX *ctx, int type, int arg, v * Note: that you cannot template 0 value. */ #define TPL(st,field) ( \ - ((st)->field) ?: TPL_VAL(st,field) \ + ((st)->field) ? ((st)->field) : TPL_VAL(st,field) \ ) #define TPL_VAL(st,field) ( \ diff --git a/gost_md.c b/gost_md.c index 6d03d50..b8824eb 100644 --- a/gost_md.c +++ b/gost_md.c @@ -37,7 +37,7 @@ GOST_digest GostR3411_94_digest = { * Note: that you cannot template 0 value. */ #define TPL(st,field) ( \ - ((st)->field) ?: TPL_VAL(st,field) \ + ((st)->field) ? ((st)->field) : TPL_VAL(st,field) \ ) #define TPL_VAL(st,field) ( \ -- 2.39.2