ソースを参照

HPCC-20752 Build and run HPCC in VS 2015

HPCC 20752 Build and run HPCC in VS 2015

HPCC 20752 Missed one file

HPCC-20752 Address code review comments

HPCC-20752 Address code review comments

HPCC-20752 Add batch file for cmake command in VS2015
Gao, Jiafu 6 年 前
コミット
5db236fc6e
45 ファイル変更160 行追加174 行削除
  1. 3 5
      CMakeLists.txt
  2. 13 0
      cmake-vs2015.bat
  3. 2 2
      cmake_modules/FindLIBXML2.cmake
  4. 4 4
      cmake_modules/FindLIBXSLT.cmake
  5. 22 2
      cmake_modules/commonSetup.cmake
  6. 3 2
      common/remote/sockfile.cpp
  7. 2 1
      configuration/configmgr/configmgrlib/CMakeLists.txt
  8. 7 7
      configuration/configmgr/configmgrlib/EnvSupportLib.cpp
  9. 1 1
      configuration/configmgr/configmgrlib/EnvSupportLib.hpp
  10. 3 2
      configuration/configmgr/configmgrlib/EnvironmentMgr.cpp
  11. 1 1
      configuration/configmgr/configmgrlib/EnvironmentNode.hpp
  12. 5 2
      dali/dafilesrv/dafilesrv.cpp
  13. 2 6
      esp/bindings/SOAP/Platform/soapbind.hpp
  14. 2 6
      esp/bindings/SOAP/Platform/soapmessage.hpp
  15. 7 7
      esp/bindings/SOAP/Platform/soapparam.hpp
  16. 1 5
      esp/bindings/SOAP/Platform/soapservice.cpp
  17. 1 5
      esp/bindings/SOAP/client/soapclient.cpp
  18. 2 6
      esp/bindings/http/client/httpclient.cpp
  19. 2 2
      esp/bindings/http/client/httpclient.hpp
  20. 2 5
      esp/bindings/http/platform/htmlpage.cpp
  21. 1 5
      esp/bindings/http/platform/httpbinding.cpp
  22. 2 5
      esp/bindings/http/platform/httpprot.cpp
  23. 1 1
      esp/bindings/http/platform/httpsecurecontext.hpp
  24. 2 5
      esp/bindings/http/platform/httpservice.cpp
  25. 1 5
      esp/bindings/http/platform/httptransport.cpp
  26. 2 6
      esp/bindings/http/platform/httptransport.ipp
  27. 2 5
      esp/bindings/http/platform/mime.cpp
  28. 2 5
      esp/bindings/http/platform/msgbuilder.cpp
  29. 1 0
      esp/clients/wsdfuaccess/CMakeLists.txt
  30. 3 6
      esp/platform/espcache.hpp
  31. 1 5
      esp/platform/espcontext.cpp
  32. 23 23
      esp/platform/espcontext.hpp
  33. 2 2
      esp/platform/esphttp.hpp
  34. 1 5
      esp/platform/espprotocol.cpp
  35. 3 1
      esp/platform/espprotocol.hpp
  36. 1 5
      esp/platform/espthread.cpp
  37. 6 4
      esp/services/ws_configmgr/CMakeLists.txt
  38. 4 0
      system/include/platform.h
  39. 2 2
      system/security/cryptohelper/cryptocommon.cpp
  40. 2 2
      system/security/cryptohelper/cryptocommon.hpp
  41. 3 3
      system/security/cryptohelper/digisign.cpp
  42. 2 2
      system/security/cryptohelper/pke.cpp
  43. 4 2
      system/security/cryptohelper/pke.hpp
  44. 2 2
      system/security/cryptohelper/ske.cpp
  45. 2 2
      system/security/cryptohelper/ske.hpp

+ 3 - 5
CMakeLists.txt

@@ -177,9 +177,7 @@ elseif ( NOT MAKE_DOCS_ONLY )
     HPCC_ADD_SUBDIRECTORY (services "PLATFORM")
     HPCC_ADD_SUBDIRECTORY (thorlcr "PLATFORM")
     HPCC_ADD_SUBDIRECTORY (testing)
-    if ( NOT WIN32 )
-        HPCC_ADD_SUBDIRECTORY (configuration)
-    endif()
+    HPCC_ADD_SUBDIRECTORY (configuration)
 
     if ( WIN32 )
         HPCC_ADD_SUBDIRECTORY (clienttools/IDEPlugins "CLIENTTOOLS_ONLY")
@@ -237,8 +235,8 @@ if(TOP_LEVEL_PROJECT)
         set(PACKAGE_FILE_NAME_PREFIX  "hpccsystems-clienttools-${projname}")
     endif()
     if(NOT "${CUSTOM_PACKAGE_SUFFIX}" STREQUAL "")
-	set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-${CUSTOM_PACKAGE_SUFFIX}")
-	set(PACKAGE_FILE_NAME_PREFIX "${PACKAGE_FILE_NAME_PREFIX}-${CUSTOM_PACKAGE_SUFFIX}")
+    set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-${CUSTOM_PACKAGE_SUFFIX}")
+    set(PACKAGE_FILE_NAME_PREFIX "${PACKAGE_FILE_NAME_PREFIX}-${CUSTOM_PACKAGE_SUFFIX}")
     endif()
 
     set(CPACK_PACKAGE_VERSION_MAJOR ${majorver})

+ 13 - 0
cmake-vs2015.bat

@@ -0,0 +1,13 @@
+@echo off
+
+REM Run this batch from the build directory.
+REM
+REM Set the git root. All projects should be checkout under this root.
+set GIT_ROOT=/git
+
+REM Then we have:
+REM c:\git\hpcc
+REM c:\git\PlatformExernalsVS2015
+REM c:\git\hpcc-bld 
+
+cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug -DEXTERNALS_DIRECTORY=%GIT_ROOT%/PlatformExternalsVS2015 -DUSE_CBLAS=OFF -DUSE_APR=OFF -DUSE_XALAN=OFF -DUSE_LIBXSLT=ON -DUSE_CASSANDRA=OFF -DWSSQL_SERVICE=OFF –DUSE_CBLAS=OFF %GIT_ROOT%/hpcc

+ 2 - 2
cmake_modules/FindLIBXML2.cmake

@@ -1,4 +1,4 @@
-################################################################################
+################################################################################
 #    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,7 +24,7 @@
 
 if (NOT LIBXML2_FOUND)
   IF (WIN32)
-    SET (libxml2_libs "xml2 libxml2")
+    SET (libxml2_libs "libxml2-2")
   ELSE()
     SET (libxml2_libs "xml2 libxml2")
   ENDIF()

+ 4 - 4
cmake_modules/FindLIBXSLT.cmake

@@ -24,8 +24,8 @@
 
 if (NOT LIBXSLT_FOUND)
   IF (WIN32)
-    SET (libxslt_libs "xslt libxslt")
-    SET (libexslt_libs "exslt libexslt")
+    SET (libxslt_libs "libxslt-1")
+    SET (libexslt_libs "libexslt")
   ELSE()
     SET (libxslt_libs "xslt libxslt")
     SET (libexslt_libs "exslt libexslt")
@@ -46,8 +46,8 @@ if (NOT LIBXSLT_FOUND)
     IF (NOT ("${osdir}" STREQUAL "unknown"))
       FIND_PATH (LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h PATHS "${EXTERNALS_DIRECTORY}/libxslt/include" NO_DEFAULT_PATH)
       FIND_LIBRARY (LIBXSLT_LIBRARIES NAMES ${libxslt_libs} PATHS "${EXTERNALS_DIRECTORY}/libxslt/${osdir}" NO_DEFAULT_PATH)
-      FIND_PATH (LIBEXSLT_INCLUDE_DIR NAMES libexslt/exslt.h PATHS "${EXTERNALS_DIRECTORY}/libexslt/include" NO_DEFAULT_PATH)
-      FIND_LIBRARY (LIBEXSLT_LIBRARIES NAMES ${libexslt_libs} PATHS "${EXTERNALS_DIRECTORY}/libexslt/${osdir}" NO_DEFAULT_PATH)
+      FIND_PATH (LIBEXSLT_INCLUDE_DIR NAMES libexslt/exslt.h PATHS "${EXTERNALS_DIRECTORY}/libxslt/include" NO_DEFAULT_PATH)
+      FIND_LIBRARY (LIBEXSLT_LIBRARIES NAMES ${libexslt_libs} PATHS "${EXTERNALS_DIRECTORY}/libxslt/${osdir}" NO_DEFAULT_PATH)
     ENDIF() 
   ENDIF()
 

+ 22 - 2
cmake_modules/commonSetup.cmake

@@ -1,4 +1,4 @@
-################################################################################
+################################################################################
 #    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License");
@@ -77,7 +77,13 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
   else()
     option(USE_NUMA "Configure use of numa" ON)
   endif()
-  option(USE_NATIVE_LIBRARIES "Search standard OS locations for thirdparty libraries" ON)
+
+  IF (WIN32)
+     option(USE_NATIVE_LIBRARIES "thirdparty libraries are in EXTERNALS_DIRECTORY" OFF)
+  ELSE()
+     option(USE_NATIVE_LIBRARIES "Search standard OS locations for thirdparty libraries" ON)
+  ENDIF()
+
   option(USE_GIT_DESCRIBE "Use git describe to generate build tag" ON)
   option(CHECK_GIT_TAG "Require git tag to match the generated build tag" OFF)
   option(USE_XALAN "Configure use of xalan" OFF)
@@ -378,6 +384,20 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
            add_definitions(/J)
         endif ()
     endif ()
+
+
+    #===  WARNING ======
+    # Temporary disable warnings. Reenable them one by one to reexamine and fix them.
+    IF (NOT ALL_WARNINGS_ON)
+      set (WARNINGS_IGNORE "/wd4267 /wd4244 /wd6340 /wd6297 /wd4018 /wd4302 /wd4311 /wd4320 /wd4800") # data conversion warnings
+      set (WARNINGS_IGNORE "${WARNINGS_IGNORE} /wd4251 /wd4275") # dll-interface for used by clients
+      set (WARNINGS_IGNORE "${WARNINGS_IGNORE} /wd6246")   # local variable hidden by outter scope
+      set (WARNINGS_IGNORE "${WARNINGS_IGNORE} /wd6031")   # Return value ignored
+      set (WARNINGS_IGNORE "${WARNINGS_IGNORE} /wd4005")   # MACRO redef: same value
+      set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${WARNINGS_IGNORE}")
+    ENDIF()
+
+
   else ()
     if (NOT CMAKE_USE_PTHREADS_INIT)
       message (FATAL_ERROR "pthreads support not detected")

+ 3 - 2
common/remote/sockfile.cpp

@@ -1,4 +1,4 @@
-/*##############################################################################
+/*##############################################################################
 
     HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
 
@@ -4510,6 +4510,7 @@ void checkExpiryTime(IPropertyTree &metaInfo)
     }
     catch (IException *e)
     {
+        e->Release();
         throw createDafsException(DAFSERR_cmdstream_invalidexpiry, "createRemoteActivity: invalid expiry specification");
     }
     CDateTime nowDt;
@@ -4537,7 +4538,7 @@ void verifyMetaInfo(IPropertyTree &actNode, bool authorizedOnly, const IProperty
     Owned<IPropertyTree> metaInfoEnvelope = createPTree(decompressedMetaInfoMb);
 
     Owned<IPropertyTree> metaInfo;
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
     MemoryBuffer metaInfoBlob;
     metaInfoEnvelope->getPropBin("metaInfoBlob", metaInfoBlob);
 

+ 2 - 1
configuration/configmgr/configmgrlib/CMakeLists.txt

@@ -51,6 +51,7 @@ if (USE_BOOST_REGEX)
         ${CMAKE_CURRENT_SOURCE_DIR}/../hpcc_support
         ${CMAKE_BINARY_DIR}
         ${CMAKE_BINARY_DIR}/oss
+        ${BOOST_REGEX_INCLUDE_DIR}
     )
 
     ADD_DEFINITIONS( -D_USRDLL -DCONFIGMGR_LIB)
@@ -60,5 +61,5 @@ if (USE_BOOST_REGEX)
     INSTALL ( TARGETS configmgr RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
 
 else ()
-    message(warning "skipping configmg - USE_BOOST_REGEX not defined")
+    message(warning "skipping configmgr - USE_BOOST_REGEX not defined")
 endif ()

+ 7 - 7
configuration/configmgr/configmgrlib/EnvSupportLib.cpp

@@ -1,4 +1,4 @@
-/*##############################################################################
+/*##############################################################################
 
     HPCC SYSTEMS software Copyright (C) 2018 HPCC Systems®.
 
@@ -19,7 +19,7 @@
 #include "EnvSupportLib.hpp"
 #include "Exceptions.hpp"
 #include "HPCCConfigSupport.hpp"
-
+#include "jutil.hpp"
 
 EnvSupportLib::EnvSupportLib(const std::string &libName, EnvironmentMgr *pEnvMgr) : m_libName(libName), m_libHandle(nullptr)
 {
@@ -29,21 +29,21 @@ EnvSupportLib::EnvSupportLib(const std::string &libName, EnvironmentMgr *pEnvMgr
         throw (ParseException(msg));
     }
 
-    m_libHandle = dlopen(m_libName.c_str(), RTLD_LAZY);
+    m_libHandle = LoadSharedObject(m_libName.c_str(),true,false);
     if (m_libHandle == nullptr)
     {
-        std::string msg = "Error opening support library " + libName + ", error = " + dlerror();
+        std::string msg = "Error opening support library " + libName + ", error = " + GetSharedObjectErrorString();
         throw (ParseException(msg));
     }
 
-    getHPCCSupportLib_t getInstanceProc = (getHPCCSupportLib_t)dlsym(m_libHandle, "getInstance");
+    getHPCCSupportLib_t getInstanceProc = (getHPCCSupportLib_t)GetSharedProcedure(m_libHandle, "getInstance");
     if (getInstanceProc != nullptr)
     {
         m_pSupportLib = getInstanceProc(pEnvMgr);;
     }
     else
     {
-        std::string msg = "Error getting getInstance function " + libName + ", error = " + dlerror();
+        std::string msg = "Error getting getInstance function " + libName + ", error = " + GetSharedObjectErrorString();
         throw (ParseException(msg));
     }
 }
@@ -53,7 +53,7 @@ EnvSupportLib::~EnvSupportLib()
 {
     if (m_libHandle != nullptr)
     {
-        dlclose(m_libHandle);
+        CloseSharedObject(m_libHandle);
         m_libHandle = nullptr;
     }
 }

+ 1 - 1
configuration/configmgr/configmgrlib/EnvSupportLib.hpp

@@ -37,7 +37,7 @@ class EnvSupportLib
 
     private:
 
-        void *m_libHandle;
+        HINSTANCE m_libHandle;
         std::string m_libName;
         HPCCConfigSupport *m_pSupportLib;
 };

+ 3 - 2
configuration/configmgr/configmgrlib/EnvironmentMgr.cpp

@@ -20,8 +20,9 @@
 #include "XMLEnvironmentMgr.hpp"
 #include "InsertableItem.hpp"
 #include "Utils.hpp"
+#ifndef WIN32
 #include <dlfcn.h>
-
+#endif
 std::atomic_int EnvironmentMgr::m_key(1);
 
 EnvironmentMgr *getEnvironmentMgrInstance(const EnvironmentType envType)
@@ -297,7 +298,7 @@ std::shared_ptr<EnvironmentNode> EnvironmentMgr::addNewEnvironmentNode(const std
     std::vector<NameValue> empty;
     for (auto &pCfgChild: cfgItemChildren)
     {
-        for (int i = 0; i<pCfgChild->getMinInstances(); ++i)
+        for (unsigned i = 0; i<pCfgChild->getMinInstances(); ++i)
         {
             addNewEnvironmentNode(pNewEnvNode, pCfgChild, empty, status);
         }

+ 1 - 1
configuration/configmgr/configmgrlib/EnvironmentNode.hpp

@@ -43,7 +43,7 @@ class DECL_EXPORT EnvironmentNode : public std::enable_shared_from_this<Environm
         void removeAllChildren(std::vector<std::string> &removedNodeIds);
         void getChildren(std::vector<std::shared_ptr<EnvironmentNode>> &children, const std::string &name=std::string("")) const;
         bool hasChildren() const { return m_children.size() != 0; }
-        int getNumChildren() const { return m_children.size(); }
+        int getNumChildren() const { return (int)m_children.size(); }
         std::shared_ptr<EnvironmentNode> getParent() const;
         void setParent(const std::shared_ptr<EnvironmentNode> &pParent) { m_pParent = pParent; }
         bool addAttribute(const std::string &name, std::shared_ptr<EnvironmentValue> pValue);

+ 5 - 2
dali/dafilesrv/dafilesrv.cpp

@@ -1,4 +1,4 @@
-/*##############################################################################
+/*##############################################################################
 
     HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
 
@@ -34,7 +34,7 @@
 
 static const bool defaultRowServiceOnStdPort = true;
 static const bool defaultDedicatedRowServiceSSL = false;
-
+static const char* defaultRowSericeConfiguration = "RowSvc";
 
 
 #include "remoteerr.hpp"
@@ -386,6 +386,7 @@ int main(int argc,char **argv)
     unsigned throttleSlowQueueLimit = DEFAULT_SLOWCMD_THROTTLEQUEUELIMIT;
 
     unsigned dedicatedRowServicePort = DEFAULT_ROWSERVICE_PORT;
+    StringAttr rowServiceConfiguration = defaultRowSericeConfiguration;
     bool dedicatedRowServiceSSL = defaultDedicatedRowServiceSSL;
     bool rowServiceOnStdPort = defaultRowServiceOnStdPort;
 
@@ -434,6 +435,8 @@ int main(int argc,char **argv)
             dedicatedRowServicePort = daFileSrv->getPropInt("@rowServicePort", DEFAULT_ROWSERVICE_PORT);
             dedicatedRowServiceSSL = daFileSrv->getPropBool("@rowServiceSSL", defaultDedicatedRowServiceSSL);
             rowServiceOnStdPort = daFileSrv->getPropBool("@rowServiceOnStdPort", defaultRowServiceOnStdPort);
+            if (daFileSrv->queryProp("@rowServiceConfiguration"))
+                rowServiceConfiguration = daFileSrv->queryProp("@rowServiceConfiguration");
 
             // any overrides by Instance definitions?
             // NB: This won't work if netAddress is "." or if we start supporting hostnames there

+ 2 - 6
esp/bindings/SOAP/Platform/soapbind.hpp

@@ -18,15 +18,11 @@
 #ifndef _SOAPBIND_HPP__
 #define _SOAPBIND_HPP__
 
+#include "esphttp.hpp"
+
 //Jlib
 #include "jliball.hpp"
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
-
 //SCM Interfaces
 #include "esp.hpp"
 #include "soapesp.hpp"

+ 2 - 6
esp/bindings/SOAP/Platform/soapmessage.hpp

@@ -20,18 +20,14 @@
 #ifndef _SOAPMESSAGE_HPP__
 #define _SOAPMESSAGE_HPP__
 
+#include "esphttp.hpp"
+
 #include "jliball.hpp"
 #include "jexcept.hpp"
 #include "soapesp.hpp"
 #include "esp.hpp"
 
 #include "http/platform/mime.hpp"
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
-
 #include "http/platform/httptransport.ipp"
 
 #include <xpp/XmlPullParser.h>

+ 7 - 7
esp/bindings/SOAP/Platform/soapparam.hpp

@@ -58,7 +58,7 @@ template <>
 inline void appendStringBuffer(StringBuffer& s, unsigned long value)
 {   s.appendulong(value); }
 
-class ESPHTTP_API BaseEspParam
+class esp_http_decl BaseEspParam
 {
 public:
    bool isNil;
@@ -223,7 +223,7 @@ public:
     }
 };
 
-class ESPHTTP_API SoapStringParam : public BaseEspParam
+class esp_http_decl SoapStringParam : public BaseEspParam
 {
 private:
     StringBuffer value;
@@ -285,7 +285,7 @@ public:
     bool unmarshallAttach(IEspContext* ctx, IProperties &params, MapStrToBuf *attachments, const char *tagname, const char *basepath=NULL, const char* optGroup=NULL, const char *xsdtype="", const char *prefix="");
 };
 
-class ESPHTTP_API BaseEspStruct
+class esp_http_decl BaseEspStruct
 {
 private:
    nilBehavior nilBH;
@@ -377,7 +377,7 @@ public:
     }
 };
 
-class ESPHTTP_API SoapParamBinary
+class esp_http_decl SoapParamBinary
 {
 private:
    MemoryBuffer value;
@@ -415,7 +415,7 @@ public:
     }
 };
 
-class ESPHTTP_API SoapAttachString
+class esp_http_decl SoapAttachString
 {
 private:
    StringBuffer value;
@@ -530,9 +530,9 @@ public:
     }
 };
 
-ESPHTTP_API StringBuffer &buildVarPath(StringBuffer &path, const char *tagname, const char *basepath, const char *item, const char *tail, int *idx);
+esp_http_decl StringBuffer &buildVarPath(StringBuffer &path, const char *tagname, const char *basepath, const char *item, const char *tail, int *idx);
 
-class ESPHTTP_API EspBaseArrayParam
+class esp_http_decl EspBaseArrayParam
 {
 protected:
     nilBehavior nilBH;

+ 1 - 5
esp/bindings/SOAP/Platform/soapservice.cpp

@@ -17,11 +17,7 @@
 
 #pragma warning( disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
 
 //ESP Bindings
 #include "platform.h"

+ 1 - 5
esp/bindings/SOAP/client/soapclient.cpp

@@ -17,11 +17,7 @@
 
 #pragma warning( disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
 
 #include <stdlib.h>
 

+ 2 - 6
esp/bindings/http/client/httpclient.cpp

@@ -17,17 +17,13 @@
 
 #pragma warning(disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+
 //Jlib
 #include "jliball.hpp"
 
 //ESP Bindings
 #include "httpclient.ipp"
-#include "http/platform/httptransport.ipp"
+#include "http/platform/httptransport.hpp"
 #include "securesocket.hpp"
 #include "bindutil.hpp"
 #include "espplugin.ipp"

+ 2 - 2
esp/bindings/http/client/httpclient.hpp

@@ -48,7 +48,7 @@ interface IHttpClientContext : extends IInterface
 };
 
 
-ESPHTTP_API IHttpClientContext* getHttpClientContext();
-ESPHTTP_API IHttpClientContext* createHttpClientContext(IPropertyTree* config);
+esp_http_decl IHttpClientContext* getHttpClientContext();
+esp_http_decl IHttpClientContext* createHttpClientContext(IPropertyTree* config);
 
 #endif

+ 2 - 5
esp/bindings/http/platform/htmlpage.cpp

@@ -17,11 +17,8 @@
 
 #pragma warning (disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
+
 //Jlib
 #include "jliball.hpp"
 

+ 1 - 5
esp/bindings/http/platform/httpbinding.cpp

@@ -17,11 +17,7 @@
 
 #pragma warning(disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
 
 //Jlib
 #include "jliball.hpp"

+ 2 - 5
esp/bindings/http/platform/httpprot.cpp

@@ -17,11 +17,8 @@
 
 #pragma warning (disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
+
 //Jlib
 #include "jliball.hpp"
 

+ 1 - 1
esp/bindings/http/platform/httpsecurecontext.hpp

@@ -29,6 +29,6 @@ enum HttpPropertyType
     HTTP_PROPERTY_TYPE_REMOTE_ADDRESS,
 };
 
-ESPHTTP_API IEspSecureContext* createHttpSecureContext(CHttpRequest* request);
+esp_http_decl IEspSecureContext* createHttpSecureContext(CHttpRequest* request);
 
 #endif // HTTPSECURECONTEXT_HPP

+ 2 - 5
esp/bindings/http/platform/httpservice.cpp

@@ -17,11 +17,8 @@
 
 #pragma warning (disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
+
 //Jlib
 #include "jliball.hpp"
 

+ 1 - 5
esp/bindings/http/platform/httptransport.cpp

@@ -17,11 +17,7 @@
 #pragma warning(disable : 4786)
 #include "platform.h"
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
 
 #ifdef _WIN32
   #include <algorithm>

+ 2 - 6
esp/bindings/http/platform/httptransport.ipp

@@ -18,15 +18,11 @@
 #ifndef _HTTPTRANSPORT_IPP__
 #define _HTTPTRANSPORT_IPP__
 
+#include "esphttp.hpp"
+
 //Jlib
 #include "jsocket.hpp"
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
-
 //ESP Bindings
 #include "http/platform/httptransport.hpp"
 

+ 2 - 5
esp/bindings/http/platform/mime.cpp

@@ -17,11 +17,8 @@
 
 #pragma warning( disable : 4786 )
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
+
 //Jlib
 #include "jliball.hpp"
 

+ 2 - 5
esp/bindings/http/platform/msgbuilder.cpp

@@ -17,11 +17,8 @@
 
 #pragma warning (disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
+
 //Jlib
 #include "jliball.hpp"
 

+ 1 - 0
esp/clients/wsdfuaccess/CMakeLists.txt

@@ -45,6 +45,7 @@ include_directories (
          ${HPCC_SOURCE_DIR}/esp/bindings/SOAP/xpp 
          ${HPCC_SOURCE_DIR}/system/jlib 
          ${HPCC_SOURCE_DIR}/esp/platform 
+         ${HPCC_SOURCE_DIR}/esp/clients
          ${HPCC_SOURCE_DIR}/esp/bindings/SOAP/Platform 
     )
 

+ 3 - 6
esp/platform/espcache.hpp

@@ -18,13 +18,9 @@
 #ifndef _ESPCACHE_IPP__
 #define _ESPCACHE_IPP__
 
-#include "esp.hpp"
+#include "esphttp.hpp"
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esp.hpp"
 
 enum ESPCacheResult
 {
@@ -41,4 +37,5 @@ interface IEspCache : extends IInterface
 };
 
 extern esp_http_decl IEspCache* createESPCache(const char* setting);
+
 #endif

+ 1 - 5
esp/platform/espcontext.cpp

@@ -17,11 +17,7 @@
 
 #pragma warning( disable : 4786 )
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
 
 #include "jliball.hpp"
 #include "espcontext.hpp"

+ 23 - 23
esp/platform/espcontext.hpp

@@ -105,41 +105,41 @@ static const char* const PropSessionLoginURL = "@loginurl";
 
 interface IEspSecureContext;
 
-ESPHTTP_API IEspContext* createEspContext(IEspSecureContext* secureContext = NULL);
+esp_http_decl IEspContext* createEspContext(IEspSecureContext* secureContext = NULL);
 
 // Get URL parameters (include these from Content)
 // Return: a=b&c=d format. 
-ESPHTTP_API bool getUrlParams(IProperties *props, StringBuffer& params);
+esp_http_decl bool getUrlParams(IProperties *props, StringBuffer& params);
 
 // Only the original URL (not these from Content: URL form encoded)
 // Also remove these params that start with dot (.).
 // Return: a=b&c=d format. 
-ESPHTTP_API void getEspUrlParams(IEspContext& ctx, StringBuffer& params, const char* excludeParams[]);
+esp_http_decl void getEspUrlParams(IEspContext& ctx, StringBuffer& params, const char* excludeParams[]);
 
-ESPHTTP_API void addEspNativeArray(StringBuffer& schema, const char* xsdType, const char* arrayType);
-ESPHTTP_API void checkRequest(IEspContext& ctx);
+esp_http_decl void addEspNativeArray(StringBuffer& schema, const char* xsdType, const char* arrayType);
+esp_http_decl void checkRequest(IEspContext& ctx);
 
-ESPHTTP_API LogLevel getEspLogLevel(IEspContext* );
-ESPHTTP_API LogLevel getEspLogLevel();
-ESPHTTP_API bool getEspLogRequests();
-ESPHTTP_API bool getEspLogResponses();
-ESPHTTP_API LogLevel getTxSummaryLevel();
-ESPHTTP_API bool getTxSummaryResourceReq();
-ESPHTTP_API unsigned getSlowProcessingTime();
+esp_http_decl LogLevel getEspLogLevel(IEspContext* );
+esp_http_decl LogLevel getEspLogLevel();
+esp_http_decl bool getEspLogRequests();
+esp_http_decl bool getEspLogResponses();
+esp_http_decl LogLevel getTxSummaryLevel();
+esp_http_decl bool getTxSummaryResourceReq();
+esp_http_decl unsigned getSlowProcessingTime();
 
-ESPHTTP_API void ESPLOG(IEspContext* ctx, LogLevel level, const char* fmt, ...) __attribute__((format(printf, 3, 4)));
-ESPHTTP_API void ESPLOG(LogLevel level, const char* fmt, ...) __attribute__((format(printf, 2, 3)));
-ESPHTTP_API void setEspContainer(IEspContainer* container);
+esp_http_decl void ESPLOG(IEspContext* ctx, LogLevel level, const char* fmt, ...) __attribute__((format(printf, 3, 4)));
+esp_http_decl void ESPLOG(LogLevel level, const char* fmt, ...) __attribute__((format(printf, 2, 3)));
+esp_http_decl void setEspContainer(IEspContainer* container);
 
-ESPHTTP_API IEspContainer* getESPContainer();
+esp_http_decl IEspContainer* getESPContainer();
 
-ESPHTTP_API void setCFD(const char* cfd);
-ESPHTTP_API const char* getCFD();
+esp_http_decl void setCFD(const char* cfd);
+esp_http_decl const char* getCFD();
 
-ESPHTTP_API void setBuildVersion(const char* buildVersion);
-ESPHTTP_API const char* getBuildVersion();
-ESPHTTP_API void setBuildLevel(const char* buildLevel);
-ESPHTTP_API const char* getBuildLevel();
-ESPHTTP_API IEspServer* queryEspServer();
+esp_http_decl void setBuildVersion(const char* buildVersion);
+esp_http_decl const char* getBuildVersion();
+esp_http_decl void setBuildLevel(const char* buildLevel);
+esp_http_decl const char* getBuildLevel();
+esp_http_decl IEspServer* queryEspServer();
 #endif
 

+ 2 - 2
esp/platform/esphttp.hpp

@@ -19,9 +19,9 @@
 #define _ESPHTTP_HPP__
 
 #ifdef ESPHTTP_EXPORTS
-    #define ESPHTTP_API DECL_EXPORT
+    #define esp_http_decl DECL_EXPORT
 #else
-    #define ESPHTTP_API DECL_IMPORT
+    #define esp_http_decl DECL_IMPORT
 #endif
 
 #define ENABLE_NEW_SECURITY 

+ 1 - 5
esp/platform/espprotocol.cpp

@@ -17,11 +17,7 @@
 
 #pragma warning (disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
 
 #include "platform.h"
 #include "espprotocol.hpp"

+ 3 - 1
esp/platform/espprotocol.hpp

@@ -18,6 +18,8 @@
 #ifndef _ESPPROTOCOL_HPP__
 #define _ESPPROTOCOL_HPP__
 
+#include "esphttp.hpp"
+
 //Jlib
 #include "jliball.hpp"
 
@@ -148,7 +150,7 @@ typedef map<int, CEspApplicationPort*> CApplicationPortMap;
 
 #define DEFAULT_MAX_REQUEST_ENTITY_LENGTH 8000000
 
-class CEspProtocol : public CInterface,
+class esp_http_decl CEspProtocol : public CInterface,
     implements IEspProtocol,
     implements ISocketSelectNotify,
     implements IPersistentSelectNotify

+ 1 - 5
esp/platform/espthread.cpp

@@ -17,11 +17,7 @@
 
 #pragma warning (disable : 4786)
 
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl DECL_EXPORT
-#else
-    #define esp_http_decl DECL_IMPORT
-#endif
+#include "esphttp.hpp"
 
 //Jlib
 #include "jliball.hpp"

+ 6 - 4
esp/services/ws_configmgr/CMakeLists.txt

@@ -22,9 +22,9 @@ include(${HPCC_SOURCE_DIR}/esp/scm/espscm.cmake)
 
 set(SRCS
     ${ESPSCM_GENERATED_DIR}/ws_configmgr_esp.cpp
-        ws_configmgrService.cpp
-        ws_configmgr_plugin.cpp
-    )
+    ws_configmgrService.cpp
+    ws_configmgr_plugin.cpp
+)
 
 include_directories(
     ${HPCC_SOURCE_DIR}/esp/esplib
@@ -50,6 +50,7 @@ include_directories(
     ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}/oss
     ${CMAKE_BINARY_DIR}/esp/services/ws_configmgr
+    ${BOOST_REGEX_INCLUDE_DIR}
     )
 
 add_definitions(-D_USRDLL)
@@ -60,7 +61,8 @@ install(
     RUNTIME DESTINATION ${EXEC_DIR}
     LIBRARY DESTINATION ${LIB_DIR}
     COMPONENT Runtime
-    )
+)
+
 add_dependencies(ws_configmgr espscm configmgr)
 target_link_libraries(ws_configmgr
     jlib

+ 4 - 0
system/include/platform.h

@@ -171,6 +171,8 @@ typedef memsize_t rowsize_t;
 #define GetSharedProcedure(h,name) GetProcAddress(h,(char *)name)
 #define LoadSucceeded(h)           ((memsize_t)h >= 32)
 #define GetSharedObjectError()     GetLastError()
+#define GetSharedObjectErrorString() strerror(errno)
+#define CloseSharedObject(h)        FreeLibrary(h)
 #define strtok_r(a,b,c)            j_strtok_r(a,b,c)
 #define __builtin_prefetch(addr)   _mm_prefetch((const char *)(addr), _MM_HINT_T0)
 
@@ -467,6 +469,8 @@ typedef int socklen_t;
 #define GetSharedProcedure(h,name)  dlsym(h,(char *)name)
 #define LoadSucceeded(h)            (h != NULL)
 #define GetSharedObjectError()      errno
+#define GetSharedObjectErrorString() dlerror()
+#define CloseSharedObject(h)        dlclose(h)
 
 #define ThreadId pthread_t
 #define MutexId pthread_mutex_t

+ 2 - 2
system/security/cryptohelper/cryptocommon.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
 
 #include <memory>
 #include "jliball.hpp"
@@ -136,4 +136,4 @@ void throwEVPExceptionV(int code, const char *format, ...)
 
 } // end of namespace cryptohelper
 
-#endif // #if defined(_USE_OPENSSL) && !defined(_WIN32)
+#endif // #if defined(_USE_OPENSSL)

+ 2 - 2
system/security/cryptohelper/cryptocommon.hpp

@@ -18,7 +18,7 @@
 #ifndef CRYPTOCOMMON_HPP
 #define CRYPTOCOMMON_HPP
 
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
 
 #include <openssl/pem.h>
 #include <openssl/evp.h>
@@ -52,7 +52,7 @@ typedef OwnedPtrCustomFree<EVP_MD_CTX, EVP_MD_CTX_free> OwnedEVPMdCtx;
 
 } // end of namespace cryptohelper
 
-#endif // end of #if defined(_USE_OPENSSL) && !defined(_WIN32)
+#endif // end of #if defined(_USE_OPENSSL)
 
 #endif // CRYPTOCOMMON_HPP
 

+ 3 - 3
system/security/cryptohelper/digisign.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 #include "jliball.hpp"
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
 #include <openssl/pem.h>
 #include <openssl/err.h>
 #include <openssl/evp.h>
@@ -28,7 +28,7 @@
 namespace cryptohelper
 {
 
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
 
 
 //Create base 64 encoded digital signature of given data
@@ -353,7 +353,7 @@ IDigitalSignatureManager * createDigitalSignatureManagerInstanceFromKeys(const c
 //Caller must release when no longer needed
 IDigitalSignatureManager * createDigitalSignatureManagerInstanceFromKeys(CLoadedKey *pubKey, CLoadedKey *privKey)
 {
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
     return new CDigitalSignatureManager(pubKey, privKey);
 #else
     return nullptr;

+ 2 - 2
system/security/cryptohelper/pke.cpp

@@ -20,7 +20,7 @@
  * For now just RSA.
  */
 
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
 
 #include "jliball.hpp"
 #include <openssl/pem.h>
@@ -231,5 +231,5 @@ size32_t privateKeyDecrypt(MemoryBuffer &out, size32_t inSz, const void *inBytes
 
 } // end of namespace cryptohelper
 
-#endif // end of #if defined(_USE_OPENSSL) && !defined(_WIN32)
+#endif // end of #if defined(_USE_OPENSSL)
 

+ 4 - 2
system/security/cryptohelper/pke.hpp

@@ -20,7 +20,7 @@
 #ifndef PKE_HPP
 #define PKE_HPP
 
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
 
 #include "cryptocommon.hpp"
 
@@ -40,8 +40,10 @@ protected:
     void loadKeyFromMem(const char *key);
     bool loadKeyFromFile(const char *keyFile);
     void finalize(RSA *rsaKey, const char *keyName);
+
 public:
     CLoadedKey() { }
+    CLoadedKey(const CLoadedKey&) = delete;
     inline EVP_PKEY *get() const           { return key; }
     inline EVP_PKEY * operator -> () const { return key; }
     inline operator EVP_PKEY *() const     { return key; }
@@ -62,7 +64,7 @@ jlib_decl size32_t privateKeyDecrypt(void *dst, size32_t dstMaxSz, size32_t inLe
 
 #else
 class CLoadedKey;
-#endif // end of #if defined(_USE_OPENSSL) && !defined(_WIN32)
+#endif // end of #if defined(_USE_OPENSSL)
 
 #endif // PKE_HPP
 

+ 2 - 2
system/security/cryptohelper/ske.cpp

@@ -20,7 +20,7 @@
  * For now just AES.
  */
 
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
 
 #include "jliball.hpp"
 #include <openssl/pem.h>
@@ -179,5 +179,5 @@ size32_t aesDecryptWithRSAEncryptedKey(MemoryBuffer &out, size32_t inSz, const v
 
 } // end of namespace cryptohelper
 
-#endif // end of #if defined(_USE_OPENSSL) && !defined(_WIN32)
+#endif // end of #if defined(_USE_OPENSSL)
 

+ 2 - 2
system/security/cryptohelper/ske.hpp

@@ -28,7 +28,7 @@
 namespace cryptohelper
 {
 
-#if defined(_USE_OPENSSL) && !defined(_WIN32)
+#if defined(_USE_OPENSSL)
 
 const unsigned aesMaxKeySize = 256/8; // 256 bits
 const unsigned aesBlockSize = 128/8; // 128 bits
@@ -43,7 +43,7 @@ jlib_decl size32_t aesEncryptWithRSAEncryptedKey(MemoryBuffer &out, size32_t inS
 jlib_decl size32_t aesDecryptWithRSAEncryptedKey(MemoryBuffer &out, size32_t inSz, const void *inBytes, const CLoadedKey &privateKey);
 
 
-#endif // end of #if defined(_USE_OPENSSL) && !defined(_WIN32)
+#endif // end of #if defined(_USE_OPENSSL)
 
 } // end of namespace cryptohelper