From e546ad4afdbcc4f2f1dea97c85f9d82ba7a99138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 8 Apr 2015 20:27:02 +0200 Subject: [PATCH] Fix comment generated by generate_errors.pl --- library/error.c | 2 +- scripts/generate_errors.pl | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/library/error.c b/library/error.c index 31f0a1152..4281e89a7 100644 --- a/library/error.c +++ b/library/error.c @@ -496,7 +496,7 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen ) mbedtls_snprintf( buf, buflen, "X509 - Allocation of memory failed" ); if( use_ret == -(MBEDTLS_ERR_X509_FILE_IO_ERROR) ) mbedtls_snprintf( buf, buflen, "X509 - Read/write of file failed" ); -#endif /* MBEDTLS_X509_USE,X509_CREATE_C */ +#endif /* MBEDTLS_X509_USE_C || MBEDTLS_X509_CREATE_C */ // END generated code if( strlen( buf ) == 0 ) diff --git a/scripts/generate_errors.pl b/scripts/generate_errors.pl index c5bc722be..2b84cd77f 100755 --- a/scripts/generate_errors.pl +++ b/scripts/generate_errors.pl @@ -165,11 +165,25 @@ while (my $line = ) if ($ll_old_define ne "") { - $ll_code_check .= "#endif /* MBEDTLS_${ll_old_define}_C */\n"; + $ll_code_check .= "#endif /* "; + my $first = 0; + foreach my $dep (split(/,/, $ll_old_define)) + { + $ll_code_check .= " || " if ($first++); + $ll_code_check .= "MBEDTLS_${dep}_C"; + } + $ll_code_check .= " */\n"; } if ($hl_old_define ne "") { - $hl_code_check .= "#endif /* MBEDTLS_${hl_old_define}_C */\n"; + $hl_code_check .= "#endif /* "; + my $first = 0; + foreach my $dep (split(/,/, $hl_old_define)) + { + $hl_code_check .= " || " if ($first++); + $hl_code_check .= "MBEDTLS_${dep}_C"; + } + $hl_code_check .= " */\n"; } $error_format =~ s/HEADER_INCLUDED\n/$headers/g;