CPPXT-106 Start to make XMLTooling compile with VC14
authorRod Widdowson <rdw@steadingsoftware.com>
Mon, 2 May 2016 10:01:15 +0000 (11:01 +0100)
committerRod Widdowson <rdw@steadingsoftware.com>
Mon, 2 May 2016 10:15:47 +0000 (11:15 +0100)
https://issues.shibboleth.net/jira/browse/CPPXT-106

This checkin fixes all the trivial issues with compilation,
moving up from deprecated timezone to _timezone, a missed
header include and supress a warning because std::exception
isnt exported.

This does not compile because of boost issues. (CPPXT-107)
the next checkin will bodge that by excluding the failing modules.

projects/vc14/xmltooling/xmltooling-lite.vcxproj
projects/vc14/xmltooling/xmltooling.vcxproj
projects/vc14/xmltoolingtest/xmltoolingtest.vcxproj
xmltooling/security/impl/PKIXPathValidator.cpp
xmltooling/util/DateTime.cpp
xmltooling/util/Win32Threads.cpp

index 2565b91..a6d94f9 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
       <BrowseInformation>true</BrowseInformation>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>_DEBUG;XMLTOOLING_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BrowseInformation>true</BrowseInformation>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>_DEBUG;XMLTOOLING_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       </PrecompiledHeaderFile>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>XMLTOOLING_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       </PrecompiledHeaderFile>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>XMLTOOLING_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
index 6205832..2f8df29 100644 (file)
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       </PrecompiledHeaderFile>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <Link>
       <AdditionalDependencies>wsock32.lib;log4shib1.lib;xerces-c_3.lib;xsec_1.lib;libeay32.lib;ssleay32.lib;libcurl5_imp.lib;%(AdditionalDependencies)</AdditionalDependencies>
       </PrecompiledHeaderFile>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <Link>
       <AdditionalDependencies>wsock32.lib;log4shib1.lib;xerces-c_3.lib;xsec_1.lib;libeay32.lib;ssleay32.lib;libcurl5_imp.lib;%(AdditionalDependencies)</AdditionalDependencies>
index f25eca5..d33def9 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -99,6 +99,7 @@
       <BrowseInformation>true</BrowseInformation>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <Link>
       <AdditionalDependencies>xerces-c_3D.lib;xsec_1D.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <BrowseInformation>true</BrowseInformation>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <Link>
       <AdditionalDependencies>xerces-c_3D.lib;xsec_1D.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <Link>
       <AdditionalDependencies>xerces-c_3.lib;xsec_1.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4275</DisableSpecificWarnings>
     </ClCompile>
     <Link>
       <AdditionalDependencies>xerces-c_3.lib;xsec_1.lib;%(AdditionalDependencies)</AdditionalDependencies>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
index ce8d894..3ac8308 100644 (file)
@@ -38,6 +38,7 @@
 #include <memory>
 #include <algorithm>
 #include <fstream>
+#include <time.h>
 #include <openssl/x509_vfy.h>
 #include <openssl/x509v3.h>
 #include <xsec/enc/OpenSSL/OpenSSLCryptoX509.hpp>
@@ -94,8 +95,11 @@ namespace {
             t.tm_mon--;
 #if defined(HAVE_TIMEGM)
             return timegm(&t);
+#elif defined(WIN32)
+            // Windows
+            return mktime(&t) - _timezone;
 #else
-            // Windows, and hopefully most others...?
+            // Hopefully most others...?
             return mktime(&t) - timezone;
 #endif
         }
index 64fe2eb..a118879 100644 (file)
@@ -546,8 +546,11 @@ time_t DateTime::getEpoch(bool duration) const
         t.tm_isdst=0;
 #if defined(HAVE_TIMEGM)
         return timegm(&t);
+#elif defined(WIN32)
+        // Windows
+        return mktime(&t) - _timezone;
 #else
-        // Windows, and hopefully most others...?
+        // Hopefully most others...?
         return mktime(&t) - timezone;
 #endif
     }
index 237c496..bd244cb 100644 (file)
@@ -29,6 +29,7 @@
 #include "util/Threads.h"
 
 #include <algorithm>
+#include<xfunctional>
 
 #ifndef WIN32
 # error "This implementation is for WIN32 platforms."