From: Vitaly Chikunov Date: Fri, 3 Dec 2021 09:06:25 +0000 (+0300) Subject: MSVC: Fix Elvis operator X-Git-Tag: v3.0.1~33 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=34dbff392d06471bd4d57395ad16b770e505e2a3;p=openssl-gost%2Fengine.git 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 --- 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) ( \