Fixed to the features check
diff --git a/include/polarssl/version.h b/include/polarssl/version.h
index 1c504fa..8527dd2 100644
--- a/include/polarssl/version.h
+++ b/include/polarssl/version.h
@@ -99,7 +99,9 @@
  *
  * \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 c6a424f..1b1a918 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 @@
 {
     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 7af2ac9..529794a 100644
--- a/visualc/VS2010/PolarSSL.vcxproj
+++ b/visualc/VS2010/PolarSSL.vcxproj
@@ -265,6 +265,7 @@
     <ClCompile Include="..\..\library\threading.c" />

     <ClCompile Include="..\..\library\timing.c" />

     <ClCompile Include="..\..\library\version.c" />

+    <ClCompile Include="..\..\library\version_features.c" />

     <ClCompile Include="..\..\library\x509.c" />

     <ClCompile Include="..\..\library\x509_create.c" />

     <ClCompile Include="..\..\library\x509_crl.c" />

diff --git a/visualc/VS6/polarssl.dsp b/visualc/VS6/polarssl.dsp
index 205dfd6..71dfd7f 100644
--- a/visualc/VS6/polarssl.dsp
+++ b/visualc/VS6/polarssl.dsp
@@ -317,6 +317,10 @@
 # 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