From 790e395729ea3915a1bf3cdc284e2fff574c2840 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Wed, 30 Apr 2014 16:48:32 +0200 Subject: [PATCH] Fixed to the features check --- include/polarssl/version.h | 4 +++- scripts/data_files/version_features.fmt | 5 +++++ visualc/VS2010/PolarSSL.vcxproj | 1 + visualc/VS6/polarssl.dsp | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/polarssl/version.h b/include/polarssl/version.h index 1c504fafb..8527dd2b8 100644 --- a/include/polarssl/version.h +++ b/include/polarssl/version.h @@ -99,7 +99,9 @@ void version_get_string_full( char *string ); * * \param feature The string for the define to check (e.g. "POLARSSL_AES_C") * - * \return 0 if the feature is present, -1 if not. + * \return 0 if the feature is present, -1 if the feature is not + * present and -2 if support for feature checking as a whole + * was not compiled in. */ int version_check_feature( const char *feature ); diff --git a/scripts/data_files/version_features.fmt b/scripts/data_files/version_features.fmt index c6a424f5d..1b1a91849 100644 --- a/scripts/data_files/version_features.fmt +++ b/scripts/data_files/version_features.fmt @@ -41,7 +41,9 @@ #endif const char *features[] = { +#if defined(POLARSSL_VERSION_FEATURES) FEATURE_DEFINES +#endif NULL }; @@ -49,6 +51,9 @@ int version_check_feature( const char *feature ) { const char **idx = features; + if( *idx == NULL ) + return( -2 ); + if( feature == NULL ) return( -1 ); diff --git a/visualc/VS2010/PolarSSL.vcxproj b/visualc/VS2010/PolarSSL.vcxproj index 7af2ac933..529794adb 100644 --- a/visualc/VS2010/PolarSSL.vcxproj +++ b/visualc/VS2010/PolarSSL.vcxproj @@ -265,6 +265,7 @@ + diff --git a/visualc/VS6/polarssl.dsp b/visualc/VS6/polarssl.dsp index 205dfd647..71dfd7f12 100644 --- a/visualc/VS6/polarssl.dsp +++ b/visualc/VS6/polarssl.dsp @@ -317,6 +317,10 @@ SOURCE=..\..\library\version.c # End Source File # Begin Source File +SOURCE=..\..\library\version_features.c +# End Source File +# Begin Source File + SOURCE=..\..\library\x509.c # End Source File # Begin Source File