From 969c01a2346f21909e961795a18cc29864b03fb9 Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Fri, 10 Dec 2021 20:29:02 +0800 Subject: [PATCH] Beauty source code Signed-off-by: Jerry Yu --- scripts/data_files/query_config.fmt | 4 ++-- tests/ssl-opt.sh | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/data_files/query_config.fmt b/scripts/data_files/query_config.fmt index 325f43d84c..61dc690caa 100644 --- a/scripts/data_files/query_config.fmt +++ b/scripts/data_files/query_config.fmt @@ -115,9 +115,9 @@ #define MACRO_NAME_TO_STR(macro) \ mbedtls_printf( "%s", strlen( #macro "" ) > 0 ? #macro "\n" : "" ) -#define NAME_TO_STR(macro) #macro +#define STRINGIFY(macro) #macro #define OUTPUT_MACRO_NAME_VALUE(macro) mbedtls_printf( #macro "%s\n", \ - strlen( NAME_TO_STR(macro) "") > 0 ? "=" NAME_TO_STR(macro) : "" ) + STRINGIFY(macro)[0] != 0 ? "=" STRINGIFY(macro) : "" ) #if defined(_MSC_VER) /* diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index c3f1b094ea..781f4022a6 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -203,8 +203,7 @@ skip_next_test() { # skip next test if the flag is not enabled in config.h requires_config_enabled() { case $CONFIGS_ENABLED in - *" $1 "*) :;; - *" $1="*) :;; + *" $1"[\ =]*) :;; *) SKIP_NEXT="YES";; esac } @@ -212,8 +211,7 @@ requires_config_enabled() { # skip next test if the flag is enabled in config.h requires_config_disabled() { case $CONFIGS_ENABLED in - *" $1 "*) SKIP_NEXT="YES";; - *" $1="*) SKIP_NEXT="YES";; + *" $1"[\ =]*) SKIP_NEXT="YES";; esac }