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;