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