Browse Source

HPCC-8983 Add support for -fvisibility to reduce dll exports

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 9 years ago
parent
commit
16d67414b1
100 changed files with 248 additions and 332 deletions
  1. 3 0
      cmake_modules/commonSetup.cmake
  2. 2 6
      common/deftype/deftype.hpp
  3. 2 6
      common/deftype/defvalue.hpp
  4. 3 7
      common/dllserver/dllserver.hpp
  5. 2 6
      common/environment/dalienv.hpp
  6. 3 7
      common/environment/environment.hpp
  7. 3 7
      common/fileview2/fileview.hpp
  8. 3 7
      common/fileview2/fvwugen.hpp
  9. 2 2
      common/remote/hooks/git/gitfile.hpp
  10. 2 2
      common/remote/hooks/libarchive/archive.hpp
  11. 7 1
      common/remote/remoteerr.hpp
  12. 2 2
      common/remote/rmtfile.hpp
  13. 2 2
      common/remote/rmtpass.hpp
  14. 2 2
      common/remote/rmtsmtp.hpp
  15. 2 2
      common/remote/rmtspawn.hpp
  16. 2 2
      common/remote/rmtssh.hpp
  17. 1 1
      common/remote/sockfile.cpp
  18. 2 2
      common/remote/sockfile.hpp
  19. 0 2
      common/roxiecommlib/CMakeLists.txt
  20. 41 9
      common/roxiecommlib/roxiecommlib.hpp
  21. 3 7
      common/thorhelper/csvsplitter.hpp
  22. 2 6
      common/thorhelper/thorcommon.ipp
  23. 3 7
      common/thorhelper/thorfile.hpp
  24. 3 7
      common/thorhelper/thorhelper.hpp
  25. 3 7
      common/thorhelper/thorparse.hpp
  26. 3 7
      common/thorhelper/thorpipe.hpp
  27. 3 7
      common/thorhelper/thorregex.hpp
  28. 2 2
      common/thorhelper/thorsoapcall.cpp
  29. 3 7
      common/thorhelper/thorsoapcall.hpp
  30. 3 7
      common/thorhelper/thorxmlread.hpp
  31. 3 7
      common/thorhelper/thorxmlwrite.hpp
  32. 7 10
      common/workunit/workunit.hpp
  33. 11 9
      common/workunit/workunit.ipp
  34. 3 7
      common/wuwebview/wuwebview.hpp
  35. 0 1
      dali/base/daaudit.cpp
  36. 1 1
      dali/base/daaudit.hpp
  37. 2 2
      dali/base/daclient.cpp
  38. 2 2
      dali/base/daclient.hpp
  39. 1 1
      dali/base/dacoven.cpp
  40. 1 1
      dali/base/dacoven.hpp
  41. 1 1
      dali/base/dacsds.cpp
  42. 2 2
      dali/base/dadfs.cpp
  43. 2 2
      dali/base/dadfs.hpp
  44. 1 1
      dali/base/dadiags.cpp
  45. 1 1
      dali/base/dadiags.hpp
  46. 1 1
      dali/base/dafdesc.cpp
  47. 1 1
      dali/base/dafdesc.hpp
  48. 1 1
      dali/base/dalock.cpp
  49. 1 1
      dali/base/dalock.hpp
  50. 1 1
      dali/base/danqs.cpp
  51. 1 1
      dali/base/danqs.hpp
  52. 1 1
      dali/base/dasds.cpp
  53. 1 1
      dali/base/dasds.hpp
  54. 1 1
      dali/base/dasds.ipp
  55. 2 2
      dali/base/dasess.cpp
  56. 1 1
      dali/base/dasess.hpp
  57. 1 1
      dali/base/dasubs.cpp
  58. 1 1
      dali/base/dasubs.hpp
  59. 1 1
      dali/base/dasubs.ipp
  60. 1 1
      dali/base/dautils.cpp
  61. 1 1
      dali/base/dautils.hpp
  62. 1 1
      dali/dfu/dfuwu.cpp
  63. 1 1
      dali/dfu/dfuwu.hpp
  64. 3 7
      dali/dfuXRefLib/XRefNodeManager.hpp
  65. 3 7
      dali/dfuXRefLib/dfuxreflib.hpp
  66. 2 6
      dali/ft/daft.hpp
  67. 2 6
      dali/ft/ftbase.hpp
  68. 1 1
      dali/sasha/packetstore.cpp
  69. 1 1
      dali/sasha/packetstore.hpp
  70. 1 1
      dali/sasha/saserver.cpp
  71. 1 1
      dali/security/dacaplib.cpp
  72. 1 1
      dali/security/dacaplib.hpp
  73. 6 0
      dali/server/daserver.hpp
  74. 2 2
      deployment/configutils/confighelper.hpp
  75. 2 2
      deployment/deploy/deploy.hpp
  76. 2 2
      deployment/deployutils/buildset.hpp
  77. 2 2
      deployment/deployutils/deployutils.hpp
  78. 3 6
      ecl/hql/hql.hpp
  79. 2 2
      ecl/hql/hqlfold.hpp
  80. 2 4
      ecl/hqlcpp/hqlcatom.hpp
  81. 0 8
      ecl/hqlcpp/hqlccommon.hpp
  82. 2 2
      ecl/hqlcpp/hqlcpp.hpp
  83. 0 7
      ecl/hqlcpp/hqlfunc.hpp
  84. 2 2
      ecl/hqlcpp/hqlpopt.hpp
  85. 2 2
      ecl/hqlcpp/hqlstmt.hpp
  86. 2 2
      ecl/hqlcpp/hqlwcpp.hpp
  87. 3 7
      ecl/hthor/hthor.hpp
  88. 1 1
      ecl/hthor/hthor.ipp
  89. 2 2
      ecl/schedulectrl/eventqueue.hpp
  90. 2 2
      ecl/schedulectrl/schedulectrl.hpp
  91. 2 2
      ecl/schedulectrl/scheduleread.hpp
  92. 1 11
      esp/bindings/SOAP/Platform/soapbind.cpp
  93. 6 5
      esp/bindings/SOAP/Platform/soapbind.hpp
  94. 0 7
      esp/bindings/SOAP/Platform/soapmessage.cpp
  95. 8 5
      esp/bindings/SOAP/Platform/soapmessage.hpp
  96. 3 3
      esp/bindings/SOAP/Platform/soapservice.cpp
  97. 4 3
      esp/bindings/SOAP/client/soapclient.cpp
  98. 0 4
      esp/bindings/SOAP/client/soapclient.hpp
  99. 1 0
      esp/bindings/SOAP/soaplib/CMakeLists.txt
  100. 0 0
      esp/bindings/bindutil.cpp

+ 3 - 0
cmake_modules/commonSetup.cmake

@@ -283,6 +283,9 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
   if ((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) AND (NOT ${CMAKE_CXX_COMPILER_VERSION} MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+"))
       execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
   endif()
+  if (CMAKE_COMPILER_IS_GNUCC)
+    add_definitions (-fvisibility=hidden)
+  endif ()
   if (CMAKE_COMPILER_IS_CLANGXX)
     execute_process( COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE clang_full_version_string )
     if (${clang_full_version_string} MATCHES "Apple LLVM version ([0-9]+\\.[0-9]+\\.[0-9]+).*")

+ 2 - 6
common/deftype/deftype.hpp

@@ -20,14 +20,10 @@
 
 #include "jcomp.hpp"
 
-#ifdef _WIN32
 #ifdef DEFTYPE_EXPORTS
-#define DEFTYPE_API __declspec(dllexport)
-#else
-#define DEFTYPE_API __declspec(dllimport)
-#endif
+#define DEFTYPE_API DECL_EXPORT
 #else
-#define DEFTYPE_API
+#define DEFTYPE_API DECL_IMPORT
 #endif
 
 #define CHEAP_UCHAR_DEF

+ 2 - 6
common/deftype/defvalue.hpp

@@ -20,14 +20,10 @@
 
 #include "deftype.hpp"
 
-#ifdef _WIN32
 #ifdef DEFTYPE_EXPORTS
-#define DEFTYPE_API __declspec(dllexport)
+#define DEFTYPE_API DECL_EXPORT
 #else
-#define DEFTYPE_API __declspec(dllimport)
-#endif
-#else
-#define DEFTYPE_API
+#define DEFTYPE_API DECL_IMPORT
 #endif
 
 #define DEFVALUE_MALLOC_FAILED 701  //Unable to allocate requested memory

+ 3 - 7
common/dllserver/dllserver.hpp

@@ -18,14 +18,10 @@
 #ifndef DLLSERVER_INCL
 #define DLLSERVER_INCL
 
-#ifdef _WIN32
-    #ifdef DLLSERVER_EXPORTS
-        #define DLLSERVER_API __declspec(dllexport)
-    #else
-        #define DLLSERVER_API __declspec(dllimport)
-    #endif
+#ifdef DLLSERVER_EXPORTS
+    #define DLLSERVER_API DECL_EXPORT
 #else
-    #define DLLSERVER_API
+    #define DLLSERVER_API DECL_IMPORT
 #endif
 
 #include "jiface.hpp"

+ 2 - 6
common/environment/dalienv.hpp

@@ -18,14 +18,10 @@
 #ifndef DALIENV_HPP
 #define DALIENV_HPP
 
-#ifdef _WIN32
 #ifdef ENVIRONMENT_EXPORTS
-#define ENVIRONMENT_API __declspec(dllexport)
+#define ENVIRONMENT_API DECL_EXPORT
 #else
-#define ENVIRONMENT_API __declspec(dllimport)
-#endif
-#else
-#define ENVIRONMENT_API
+#define ENVIRONMENT_API DECL_IMPORT
 #endif
 
 #include "environment.hpp"

+ 3 - 7
common/environment/environment.hpp

@@ -25,14 +25,10 @@
 
 #include "dasubs.hpp"
 
-#ifdef WIN32
-    #ifdef ENVIRONMENT_EXPORTS
-        #define ENVIRONMENT_API __declspec(dllexport)
-    #else
-        #define ENVIRONMENT_API __declspec(dllimport)
-    #endif
+#ifdef ENVIRONMENT_EXPORTS
+    #define ENVIRONMENT_API DECL_EXPORT
 #else
-    #define ENVIRONMENT_API
+    #define ENVIRONMENT_API DECL_IMPORT
 #endif
 
 interface IPropertyTree;   // Not yet SCM-compliant

+ 3 - 7
common/fileview2/fileview.hpp

@@ -18,14 +18,10 @@
 #ifndef FILEVIEW_INCL
 #define FILEVIEW_INCL
 
-#ifdef _WIN32
-    #ifdef FILEVIEW2_EXPORTS
-        #define FILEVIEW_API __declspec(dllexport)
-    #else
-        #define FILEVIEW_API __declspec(dllimport)
-    #endif
+#ifdef FILEVIEW2_EXPORTS
+    #define FILEVIEW_API DECL_EXPORT
 #else
-    #define FILEVIEW_API
+    #define FILEVIEW_API DECL_IMPORT
 #endif
 
 #include "workunit.hpp"

+ 3 - 7
common/fileview2/fvwugen.hpp

@@ -18,14 +18,10 @@
 #ifndef FVWUGEN_HPP
 #define FVWUGEN_HPP
 
-#ifdef _WIN32
-    #ifdef FILEVIEW2_EXPORTS
-        #define FILEVIEW_API __declspec(dllexport)
-    #else
-        #define FILEVIEW_API __declspec(dllimport)
-    #endif
+#ifdef FILEVIEW2_EXPORTS
+    #define FILEVIEW_API DECL_EXPORT
 #else
-    #define FILEVIEW_API
+    #define FILEVIEW_API DECL_IMPORT
 #endif
 
 #define LOWER_LIMIT_ID      "__startPos__"

+ 2 - 2
common/remote/hooks/git/gitfile.hpp

@@ -21,9 +21,9 @@
 #include "jfile.hpp"
 
 #ifdef GITFILE_EXPORTS
-#define GITFILE_API __declspec(dllexport)
+#define GITFILE_API DECL_EXPORT
 #else
-#define GITFILE_API __declspec(dllimport)
+#define GITFILE_API DECL_IMPORT
 #endif
 
 

+ 2 - 2
common/remote/hooks/libarchive/archive.hpp

@@ -21,9 +21,9 @@
 #include "jfile.hpp"
 
 #ifdef ARCHIVEFILE_EXPORTS
-#define ARCHIVEFILE_API __declspec(dllexport)
+#define ARCHIVEFILE_API DECL_EXPORT
 #else
-#define ARCHIVEFILE_API __declspec(dllimport)
+#define ARCHIVEFILE_API DECL_IMPORT
 #endif
 
 

+ 7 - 1
common/remote/remoteerr.hpp

@@ -18,6 +18,12 @@
 #ifndef REMOTEERR_HPP
 #define REMOTEERR_HPP
 
+#ifdef REMOTE_EXPORTS
+#define REMOTE_API DECL_EXPORT
+#else
+#define REMOTE_API DECL_IMPORT
+#endif
+
 #define ERR_REMOTE_FIRST                        8000
 #define ERR_REMOTE_LAST                         8049
 
@@ -80,7 +86,7 @@
 #define RAERR_InvalidUsernamePassword_Text      "Invalid (upper case U) in username/password"
 
 
-interface IDAFS_Exception: extends IException
+interface REMOTE_API IDAFS_Exception: extends IException
 { // Raise by dafilesrv calls
 };
 

+ 2 - 2
common/remote/rmtfile.hpp

@@ -24,9 +24,9 @@
 #include "sockfile.hpp"
 
 #ifdef REMOTE_EXPORTS
-#define REMOTE_API __declspec(dllexport)
+#define REMOTE_API DECL_EXPORT
 #else
-#define REMOTE_API __declspec(dllimport)
+#define REMOTE_API DECL_IMPORT
 #endif
 
 enum DAFS_OS

+ 2 - 2
common/remote/rmtpass.hpp

@@ -19,9 +19,9 @@
 #define RMTPASS_HPP
 
 #ifdef REMOTE_EXPORTS
-#define REMOTE_API __declspec(dllexport)
+#define REMOTE_API DECL_EXPORT
 #else
-#define REMOTE_API __declspec(dllimport)
+#define REMOTE_API DECL_IMPORT
 #endif
 
 class REMOTE_API CachedPassword : public CInterface

+ 2 - 2
common/remote/rmtsmtp.hpp

@@ -22,9 +22,9 @@
 #include "jstring.hpp"
 
 #ifdef REMOTE_EXPORTS
-#define REMOTE_API __declspec(dllexport)
+#define REMOTE_API DECL_EXPORT
 #else
-#define REMOTE_API __declspec(dllimport)
+#define REMOTE_API DECL_IMPORT
 #endif
 
 extern REMOTE_API void sendEmail( const char * to, const char * subject, const char * body, const char * mailServer, unsigned port, const char * sender, StringArray *warnings=NULL);

+ 2 - 2
common/remote/rmtspawn.hpp

@@ -19,9 +19,9 @@
 #define RMTSPAWN_HPP
 
 #ifdef REMOTE_EXPORTS
-#define REMOTE_API __declspec(dllexport)
+#define REMOTE_API DECL_EXPORT
 #else
-#define REMOTE_API __declspec(dllimport)
+#define REMOTE_API DECL_IMPORT
 #endif
 
 #define SLAVE_LISTEN_FOR_MASTER_TIMEOUT             5 * 60 * 1000           // 2 minutes

+ 2 - 2
common/remote/rmtssh.hpp

@@ -22,9 +22,9 @@
 #define RMTSSH_API
 #else
 #ifdef REMOTE_EXPORTS
-#define RMTSSH_API __declspec(dllexport)
+#define RMTSSH_API DECL_EXPORT
 #else
-#define RMTSSH_API __declspec(dllimport)
+#define RMTSSH_API DECL_IMPORT
 #endif
 #endif
 

+ 1 - 1
common/remote/sockfile.cpp

@@ -491,7 +491,7 @@ static void mergeOnce(OnceKey &key,size32_t sz,const void *data)
 
 //---------------------------------------------------------------------------
 
-class CDafsException: public IDAFS_Exception, public CInterface
+class DECL_EXCEPTION CDafsException: public IDAFS_Exception, public CInterface
 {
     int     errcode;
     StringAttr msg;

+ 2 - 2
common/remote/sockfile.hpp

@@ -22,9 +22,9 @@
 #include "jfile.hpp"
 
 #ifdef REMOTE_EXPORTS
-#define REMOTE_API __declspec(dllexport)
+#define REMOTE_API DECL_EXPORT
 #else
-#define REMOTE_API __declspec(dllimport)
+#define REMOTE_API DECL_IMPORT
 #endif
 
 #define RFEnoerror      0

+ 0 - 2
common/roxiecommlib/CMakeLists.txt

@@ -27,8 +27,6 @@ project( roxiecommlib )
 include(${HPCC_SOURCE_DIR}/esp/scm/espscm.cmake)
 
 set (    SRCS 
-         ${ESPSCM_GENERATED_DIR}/roxiecommlibscm_esp.cpp 
-                 ${HPCC_SOURCE_DIR}/esp/scm/roxiecommlibscm.ecm
          roxiecommunicationclient.cpp 
     )
 

+ 41 - 9
common/roxiecommlib/roxiecommlib.hpp

@@ -18,22 +18,54 @@
 #ifndef ROXIECOMMLIB_INCL
 #define ROXIECOMMLIB_INCL
 
-#ifdef _WIN32
-    #ifdef ROXIECOMMLIB_EXPORTS
-        #define ROXIECOMMLIB_API __declspec(dllexport)
-    #else
-        #define ROXIECOMMLIB_API __declspec(dllimport)
-    #endif
+#ifdef ROXIECOMMLIB_EXPORTS
+    #define ROXIECOMMLIB_API DECL_EXPORT
 #else
-    #define ROXIECOMMLIB_API
+    #define ROXIECOMMLIB_API DECL_IMPORT
 #endif
 
 
-#include "roxiecommlibscm.hpp"
+#define ROXIECOMM_SOCKET_ERROR 1450
 
 
-#define ROXIECOMM_SOCKET_ERROR 1450
+#include "esp.hpp"
+#include "jptree.hpp"
+#include "jsocket.hpp"
+
+interface IUserDescriptor;
+
+interface IRoxieCommunicationClient : extends IInterface
+{
+    virtual IPropertyTree *sendRoxieControlRequest(const char *xml, bool lockAll) = 0;
+    virtual const char *sendRoxieOnDemandRequest(const char *xml, SCMStringBuffer &repsonse, bool lockAll) = 0;
+    virtual void sendRoxieReloadControlRequest() = 0;
+
+    virtual IPropertyTree *retrieveQuery(const char *id) = 0;
+    virtual IPropertyTree *retrieveAllQueryInfo(const char *id) = 0;
+    virtual IPropertyTree *retrieveState() = 0;
+
+    virtual IPropertyTree *retrieveQueryStats(const char *queryName, const char *action, const char *graphName, bool lockAll) = 0;
+    virtual const char *queryRoxieClusterName(SCMStringBuffer &clusterName) = 0;
+    virtual IPropertyTree *retrieveQueryWuInfo(const char *queryName) = 0;
+    virtual IPropertyTree *retrieveTopology() = 0;
+
+    virtual bool updateQueryComment(const char *id, const char *comment, bool append) = 0;
+    virtual bool updateACLInfo(bool allow, const char *restrict_ip, const char *mask, const char *query, const char *errorMsg, int errorCode, const char *roxieAddress, SCMStringBuffer &status) = 0;
+    virtual IPropertyTree *queryACLInfo() = 0;
+    virtual IPropertyTree *retrieveRoxieQueryMetrics(SCMStringBuffer &queryName, SCMStringBuffer &startDateTime, SCMStringBuffer &endDateTime) = 0;
+    virtual IPropertyTree *retrieveRoxieMetrics(StringArray &ipList) = 0;
+    virtual IPropertyTree *listLibrariesUsedByQuery(const char *id, bool useAliasNames) = 0;
+    virtual IPropertyTree *listQueriesUsingLibrary(const char *id) = 0;
+    virtual IPropertyTree *retrieveQueryActivityInfo(const char *id, int activityId) = 0;
+
+    virtual unsigned retrieveRoxieStateRevision() = 0;
+    virtual IPropertyTree *getRoxieBuildVersion() = 0;
 
+    virtual IPropertyTree *sendRoxieControlAllNodes(const char *msg, bool allOrNothing) = 0;
+    virtual IPropertyTree *sendRoxieControlAllNodes(ISocket *sock, const char *msg, bool allOrNothing, unsigned wait) = 0;
+    virtual IPropertyTree *sendRoxieControlQuery(ISocket *sock, const char *msg, unsigned wait) = 0;
+};
 
+extern "C" ROXIECOMMLIB_API IRoxieCommunicationClient *createRoxieCommunicationClient(const SocketEndpoint &roxieEP, unsigned roxieTimeout);
 
 #endif

+ 3 - 7
common/thorhelper/csvsplitter.hpp

@@ -18,14 +18,10 @@
 #ifndef CSVSPLITTER_INCL
 #define CSVSPLITTER_INCL
 
-#ifdef _WIN32
- #ifdef THORHELPER_EXPORTS
-  #define THORHELPER_API __declspec(dllexport)
- #else
-  #define THORHELPER_API __declspec(dllimport)
- #endif
+#ifdef THORHELPER_EXPORTS
+#define THORHELPER_API DECL_EXPORT
 #else
- #define THORHELPER_API
+#define THORHELPER_API DECL_IMPORT
 #endif
 
 #include "jregexp.hpp"

+ 2 - 6
common/thorhelper/thorcommon.ipp

@@ -24,14 +24,10 @@
 #include "rtlds_imp.hpp"
 #include "jfile.hpp"
 
-#ifdef _WIN32
 #ifdef THORHELPER_EXPORTS
-#define THORHELPER_API __declspec(dllexport)
+#define THORHELPER_API DECL_EXPORT
 #else
-#define THORHELPER_API __declspec(dllimport)
-#endif
-#else
-#define THORHELPER_API
+#define THORHELPER_API DECL_IMPORT
 #endif
 
 //------------------------------------------------------------------------------------------------

+ 3 - 7
common/thorhelper/thorfile.hpp

@@ -18,14 +18,10 @@
 #ifndef __THORFILE_HPP_
 #define __THORFILE_HPP_
 
-#ifdef _WIN32
- #ifdef THORHELPER_EXPORTS
-  #define THORHELPER_API __declspec(dllexport)
- #else
-  #define THORHELPER_API __declspec(dllimport)
- #endif
+#ifdef THORHELPER_EXPORTS
+ #define THORHELPER_API DECL_EXPORT
 #else
- #define THORHELPER_API
+ #define THORHELPER_API DECL_IMPORT
 #endif
 #include "eclhelper.hpp"
 

+ 3 - 7
common/thorhelper/thorhelper.hpp

@@ -21,14 +21,10 @@
 #include "jiface.hpp"
 #include "jptree.hpp"
 
-#ifdef _WIN32
- #ifdef THORHELPER_EXPORTS
-  #define THORHELPER_API __declspec(dllexport)
- #else
-  #define THORHELPER_API __declspec(dllimport)
- #endif
+#ifdef THORHELPER_EXPORTS
+ #define THORHELPER_API DECL_EXPORT
 #else
- #define THORHELPER_API
+ #define THORHELPER_API DECL_IMPORT
 #endif
 
 interface IXmlToRawTransformer : extends IInterface

+ 3 - 7
common/thorhelper/thorparse.hpp

@@ -18,14 +18,10 @@
 #ifndef __THORPARSE_HPP_
 #define __THORPARSE_HPP_
 
-#ifdef _WIN32
- #ifdef THORHELPER_EXPORTS
-  #define THORHELPER_API __declspec(dllexport)
- #else
-  #define THORHELPER_API __declspec(dllimport)
- #endif
+#ifdef THORHELPER_EXPORTS
+ #define THORHELPER_API DECL_EXPORT
 #else
- #define THORHELPER_API
+ #define THORHELPER_API DECL_IMPORT
 #endif
 
 typedef unsigned regexid_t;

+ 3 - 7
common/thorhelper/thorpipe.hpp

@@ -18,14 +18,10 @@
 #ifndef __THORPIPERROR_HPP_
 #define __THORPIPERROR_HPP_
 
-#ifdef _WIN32
- #ifdef THORHELPER_EXPORTS
-  #define THORHELPER_API __declspec(dllexport)
- #else
-  #define THORHELPER_API __declspec(dllimport)
- #endif
+#ifdef THORHELPER_EXPORTS
+ #define THORHELPER_API DECL_EXPORT
 #else
- #define THORHELPER_API
+ #define THORHELPER_API DECL_IMPORT
 #endif
 
 #include "jthread.hpp"

+ 3 - 7
common/thorhelper/thorregex.hpp

@@ -18,14 +18,10 @@
 #ifndef __THORRREGEX_HPP_
 #define __THORRREGEX_HPP_
 
-#ifdef _WIN32
- #ifdef THORHELPER_EXPORTS
-  #define THORHELPER_API __declspec(dllexport)
- #else
-  #define THORHELPER_API __declspec(dllimport)
- #endif
+#ifdef THORHELPER_EXPORTS
+ #define THORHELPER_API DECL_EXPORT
 #else
- #define THORHELPER_API
+ #define THORHELPER_API DECL_IMPORT
 #endif
 
 #define RegexSpecialMask                    0xF0000000

+ 2 - 2
common/thorhelper/thorsoapcall.cpp

@@ -48,7 +48,7 @@ unsigned soapTraceLevel = 1;
 #define WSCBUFFERSIZE 0x10000
 #define MAXWSCTHREADS 50    //Max Web Service Call Threads
 
-interface IReceivedRoxieException : extends IException
+interface DECL_EXCEPTION IReceivedRoxieException : extends IException
 {
 public:
     virtual const void *errorRow() = 0;
@@ -56,7 +56,7 @@ public:
 
 #define EXCEPTION_PREFIX "ReceivedRoxieException:"
 
-class ReceivedRoxieException: public IReceivedRoxieException, public CInterface
+class DECL_EXCEPTION ReceivedRoxieException: public IReceivedRoxieException, public CInterface
 {
 public:
     IMPLEMENT_IINTERFACE;

+ 3 - 7
common/thorhelper/thorsoapcall.hpp

@@ -18,14 +18,10 @@
 #ifndef __THORSOAPCALL_HPP_
 #define __THORSOAPCALL_HPP_
 
-#ifdef _WIN32
- #ifdef THORHELPER_EXPORTS
-  #define THORHELPER_API __declspec(dllexport)
- #else
-  #define THORHELPER_API __declspec(dllimport)
- #endif
+#ifdef THORHELPER_EXPORTS
+ #define THORHELPER_API DECL_EXPORT
 #else
- #define THORHELPER_API
+ #define THORHELPER_API DECL_IMPORT
 #endif
 
 #include "jlog.hpp"

+ 3 - 7
common/thorhelper/thorxmlread.hpp

@@ -18,14 +18,10 @@
 #ifndef THORXMLREAD_HPP
 #define THORXMLREAD_HPP
 
-#ifdef _WIN32
- #ifdef THORHELPER_EXPORTS
-  #define thorhelper_decl __declspec(dllexport)
- #else
-  #define thorhelper_decl __declspec(dllimport)
- #endif
+#ifdef THORHELPER_EXPORTS
+ #define thorhelper_decl DECL_EXPORT
 #else
- #define thorhelper_decl
+ #define thorhelper_decl DECL_IMPORT
 #endif
 
 #include "eclhelper.hpp"

+ 3 - 7
common/thorhelper/thorxmlwrite.hpp

@@ -18,14 +18,10 @@
 #ifndef THORXMLWRITE_HPP
 #define THORXMLWRITE_HPP
 
-#ifdef _WIN32
- #ifdef THORHELPER_EXPORTS
-  #define thorhelper_decl __declspec(dllexport)
- #else
-  #define thorhelper_decl __declspec(dllimport)
- #endif
+#ifdef THORHELPER_EXPORTS
+ #define thorhelper_decl DECL_EXPORT
 #else
- #define thorhelper_decl
+ #define thorhelper_decl DECL_IMPORT
 #endif
 
 #include "eclhelper.hpp"

+ 7 - 10
common/workunit/workunit.hpp

@@ -18,14 +18,10 @@
 #ifndef WORKUNIT_INCL
 #define WORKUNIT_INCL
 
-#ifdef _WIN32
-    #ifdef WORKUNIT_EXPORTS
-        #define WORKUNIT_API __declspec(dllexport)
-    #else
-        #define WORKUNIT_API __declspec(dllimport)
-    #endif
+#ifdef WORKUNIT_EXPORTS
+    #define WORKUNIT_API DECL_EXPORT
 #else
-    #define WORKUNIT_API
+    #define WORKUNIT_API DECL_IMPORT
 #endif
 
 #define MINIMUM_SCHEDULE_PRIORITY 0
@@ -1343,14 +1339,15 @@ interface IExtendedWUInterface
     
 };
 
+//Do not mark this as WORKUNIT_API - all functions are inline, and it causes windows link errors
 struct WorkunitUpdate : public Owned<IWorkUnit>
 {
 public:
-    WorkunitUpdate(IWorkUnit *wu) : Owned<IWorkUnit>(wu) { }
-    ~WorkunitUpdate() { if (get()) get()->commit(); }
+    inline WorkunitUpdate(IWorkUnit *wu) : Owned<IWorkUnit>(wu) { }
+    inline ~WorkunitUpdate() { if (get()) get()->commit(); }
 };
 
-class WuStatisticTarget : implements IStatisticTarget
+class WORKUNIT_API WuStatisticTarget : implements IStatisticTarget
 {
 public:
     WuStatisticTarget(IWorkUnit * _wu, const char * _defaultWho) : wu(_wu), defaultWho(_defaultWho) {}

+ 11 - 9
common/workunit/workunit.ipp

@@ -21,11 +21,13 @@
 #include "dasds.hpp"
 #include "workunit.hpp"
 
+/* NB: Some of the classes in this file are also used from casandrawu - which means they all need WORKUNIT_API */
+
 #define SDS_LOCK_TIMEOUT (5*60*1000) // 5 mins
 #define WUID_VERSION 2 // recorded in each wuid created, useful for bkwd compat. checks
 #define GLOBAL_WORKUNIT "global"
 
-class CLocalWUAppValue : implements IConstWUAppValue, public CInterface
+class WORKUNIT_API CLocalWUAppValue : implements IConstWUAppValue, public CInterface
 {
     Owned<IPropertyTree> p;
     StringAttr prop;
@@ -39,7 +41,7 @@ public:
 };
 
 
-class CLocalWUStatistic : implements IConstWUStatistic, public CInterface
+class WORKUNIT_API CLocalWUStatistic : implements IConstWUStatistic, public CInterface
 {
     Owned<IPropertyTree> p;
 public:
@@ -63,7 +65,7 @@ public:
     virtual bool matches(const IStatisticsFilter * filter) const;
 };
 
-class CLocalWULegacyTiming : implements IConstWUStatistic, public CInterface
+class WORKUNIT_API CLocalWULegacyTiming : implements IConstWUStatistic, public CInterface
 {
     Owned<IPropertyTree> p;
 public:
@@ -164,7 +166,7 @@ template <>  struct CachedTags<CLocalWUAppValue, IConstWUAppValue>
 
 //==========================================================================================
 
-class CLocalWorkUnit : implements IWorkUnit , implements IExtendedWUInterface, public CInterface
+class WORKUNIT_API CLocalWorkUnit : implements IWorkUnit , implements IExtendedWUInterface, public CInterface
 {
     friend StringBuffer &exportWorkUnitToXML(const IConstWorkUnit *wu, StringBuffer &str, bool decodeGraphs, bool includeProgress, bool hidePasswords);
     friend void exportWorkUnitToXMLFile(const IConstWorkUnit *wu, const char * filename, unsigned extraXmlFlags, bool decodeGraphs, bool includeProgress, bool hidePasswords);
@@ -570,7 +572,7 @@ protected:
     virtual void _loadExceptions() const;
 };
 
-class CPersistedWorkUnit : public CLocalWorkUnit, implements IWorkUnitSubscriber
+class WORKUNIT_API CPersistedWorkUnit : public CLocalWorkUnit, implements IWorkUnitSubscriber
 {
 public:
     CPersistedWorkUnit(ISecManager *secmgr, ISecUser *secuser) : CLocalWorkUnit(secmgr, secuser)
@@ -588,7 +590,7 @@ protected:
     mutable bool abortState;
 };
 
-class CWorkUnitFactory : implements IWorkUnitFactory, public CInterface
+class WORKUNIT_API CWorkUnitFactory : implements IWorkUnitFactory, public CInterface
 {
 public:
     IMPLEMENT_IINTERFACE;
@@ -639,7 +641,7 @@ protected:
     virtual bool _restoreWorkUnit(IPTree *pt, const char *wuid) = 0;
 };
 
-class CLocalWUGraph : implements IConstWUGraph, public CInterface
+class WORKUNIT_API CLocalWUGraph : implements IConstWUGraph, public CInterface
 {
     const CLocalWorkUnit &owner;
     Owned<IPropertyTree> p;
@@ -668,7 +670,7 @@ public:
     void setXGMMLTree(IPropertyTree * tree);
 };
 
-class CWuGraphStats : public CInterfaceOf<IWUGraphStats>
+class WORKUNIT_API CWuGraphStats : public CInterfaceOf<IWUGraphStats>
 {
 public:
     CWuGraphStats(IPropertyTree *_progress, StatisticCreatorType _creatorType, const char * _creator, const char * _rootScope, unsigned _id);
@@ -682,7 +684,7 @@ protected:
     unsigned id;
 };
 
-class CWorkUnitWatcher : public CInterface, implements IWorkUnitWatcher, implements ISDSSubscription
+class WORKUNIT_API CWorkUnitWatcher : public CInterface, implements IWorkUnitWatcher, implements ISDSSubscription
 {
 protected:
     CriticalSection crit;

+ 3 - 7
common/wuwebview/wuwebview.hpp

@@ -18,14 +18,10 @@
 #ifndef WUWEBVIEW_INCL
 #define WUWEBVIEW_INCL
 
-#ifdef _WIN32
-    #ifdef WUWEBVIEW_EXPORTS
-        #define WUWEBVIEW_API __declspec(dllexport)
-    #else
-        #define WUWEBVIEW_API __declspec(dllimport)
-    #endif
+#ifdef WUWEBVIEW_EXPORTS
+    #define WUWEBVIEW_API DECL_EXPORT
 #else
-    #define WUWEBVIEW_API
+    #define WUWEBVIEW_API DECL_IMPORT
 #endif
 
 #define WWV_OMIT_XML_DECLARATION        0x0001

+ 0 - 1
dali/base/daaudit.cpp

@@ -15,7 +15,6 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
 #include "platform.h"
 #include "jlib.hpp"
 #include "jfile.hpp"

+ 1 - 1
dali/base/daaudit.hpp

@@ -19,7 +19,7 @@
 #define DAAUDIT_HPP
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 class CDateTime;

+ 2 - 2
dali/base/daclient.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include "jlib.hpp"
 #include "jexcept.hpp"
@@ -48,7 +48,7 @@ MODULE_EXIT()
 }
 
 
-class CDaliClientException: public IDaliClient_Exception, public CInterface
+class DECL_EXCEPTION CDaliClientException: public IDaliClient_Exception, public CInterface
 {
 public:
     IMPLEMENT_IINTERFACE;

+ 2 - 2
dali/base/daclient.hpp

@@ -19,7 +19,7 @@
 #define DACLIENT_HPP
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 #include "jlib.hpp"
@@ -40,7 +40,7 @@ interface IDaliClientShutdown : extends IInterface
 extern da_decl void addShutdownHook(IDaliClientShutdown &shutdown);
 extern da_decl void removeShutdownHook(IDaliClientShutdown &shutdown);
 
-interface IDaliClient_Exception: extends IException
+interface da_decl IDaliClient_Exception: extends IException
 {
 };
 

+ 1 - 1
dali/base/dacoven.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include <time.h>
 #include "jlib.hpp"

+ 1 - 1
dali/base/dacoven.hpp

@@ -19,7 +19,7 @@
 #define DACOVEN_HPP
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 #include "jlog.hpp"

+ 1 - 1
dali/base/dacsds.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include <typeinfo>
 #include "jlib.hpp"

+ 2 - 2
dali/base/dadfs.cpp

@@ -16,7 +16,7 @@
 ############################################################################## */
 
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include "jlib.hpp"
 #include "jfile.hpp"
@@ -219,7 +219,7 @@ inline void LOGFDESC(const char *title,IFileDescriptor *fdesc)
 }
 
 
-class CDFS_Exception: implements IDFS_Exception, public CInterface
+class DECL_EXCEPTION CDFS_Exception: implements IDFS_Exception, public CInterface
 {
     int errcode;
     StringAttr errstr;

+ 2 - 2
dali/base/dadfs.hpp

@@ -27,7 +27,7 @@
 #define DADFS_HPP
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 #include "jiface.hpp"
@@ -729,7 +729,7 @@ extern da_decl bool decodeChildGroupName(const char *gname,StringBuffer &parentn
 
 // Exceptions
 
-interface IDFS_Exception: extends IException
+interface da_decl IDFS_Exception: extends IException
 {
 };
 

+ 1 - 1
dali/base/dadiags.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include "jlib.hpp"
 #include "dacoven.hpp"

+ 1 - 1
dali/base/dadiags.hpp

@@ -19,7 +19,7 @@
 #define DADIAGS_HPP
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 extern da_decl StringBuffer & getDaliDiagnosticValue(const char *name,StringBuffer &ret);

+ 1 - 1
dali/base/dafdesc.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include "portlist.h"
 #include "jlib.hpp"

+ 1 - 1
dali/base/dafdesc.hpp

@@ -19,7 +19,7 @@
 #define DAFDESC_HPP
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 #include "jiface.hpp"

+ 1 - 1
dali/base/dalock.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include "jlib.hpp"
 #include "jsuperhash.hpp"

+ 1 - 1
dali/base/dalock.hpp

@@ -19,7 +19,7 @@
 #define DALOCK_HPP
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 #include "platform.h"

+ 1 - 1
dali/base/danqs.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include "jlib.hpp"
 #include "jsuperhash.hpp"

+ 1 - 1
dali/base/danqs.hpp

@@ -19,7 +19,7 @@
 #define DANQS_HPP
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 #include "mpbuff.hpp"

+ 1 - 1
dali/base/dasds.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include "jhash.hpp"
 #include "jlib.hpp"

+ 1 - 1
dali/base/dasds.hpp

@@ -213,7 +213,7 @@ enum SDSExceptionCodes
     SDSExcpt_SubscriptionNoMatch
 };
 
-interface ISDSException : extends IException { };
+interface da_decl ISDSException : extends IException { };
 
 extern da_decl ISDSManagerServer &querySDSServer();
 

+ 1 - 1
dali/base/dasds.ipp

@@ -352,7 +352,7 @@ protected:
     ChangeInfoMap changeMap;
 };
 
-class CSDSException : implements ISDSException, public CInterface
+class DECL_EXCEPTION CSDSException : implements ISDSException, public CInterface
 {
 public:
     IMPLEMENT_IINTERFACE;

+ 2 - 2
dali/base/dasess.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include "jlib.hpp"
 #include "jfile.hpp"
@@ -101,7 +101,7 @@ static CriticalSection sessionCrit;
 #define CLDAPE_getpermtimeout (-1)
 #define CLDAPE_ldapfailure    (-2)
 
-class CDaliLDAP_Exception: implements IException, public CInterface
+class DECL_EXCEPTION CDaliLDAP_Exception: implements IException, public CInterface
 {
     int errcode;
 public:

+ 1 - 1
dali/base/dasess.hpp

@@ -19,7 +19,7 @@
 #define DASESS_HPP
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 #ifdef _WIN32

+ 1 - 1
dali/base/dasubs.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 #include "platform.h"
 #include "jlib.hpp"
 #include "jmisc.hpp"

+ 1 - 1
dali/base/dasubs.hpp

@@ -21,7 +21,7 @@
 #include "dasess.hpp"
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 typedef DALI_UID SubscriptionId; // allocated by queryCoven().getUniqueId() 

+ 1 - 1
dali/base/dasubs.ipp

@@ -21,7 +21,7 @@
 #include "dasubs.hpp"
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 interface ISubscription: extends IInterface             

+ 1 - 1
dali/base/dautils.cpp

@@ -15,7 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
-#define da_decl __declspec(dllexport)
+#define da_decl DECL_EXPORT
 
 #include "platform.h"
 #include "jlib.hpp"

+ 1 - 1
dali/base/dautils.hpp

@@ -28,7 +28,7 @@
 #include "dasess.hpp"
 
 #ifndef da_decl
-#define da_decl __declspec(dllimport)
+#define da_decl DECL_IMPORT
 #endif
 
 interface IRemoteConnection;

+ 1 - 1
dali/dfu/dfuwu.cpp

@@ -24,7 +24,7 @@
 #include "jencrypt.hpp"
 
 #ifndef dfuwu_decl
-#define dfuwu_decl __declspec(dllexport)
+#define dfuwu_decl DECL_EXPORT
 #endif
 
 

+ 1 - 1
dali/dfu/dfuwu.hpp

@@ -19,7 +19,7 @@
 #define DFUWU_INCL
 
 #ifndef dfuwu_decl
-#define dfuwu_decl __declspec(dllimport)
+#define dfuwu_decl DECL_IMPORT
 #endif
 
 #include "jtime.hpp"

+ 3 - 7
dali/dfuXRefLib/XRefNodeManager.hpp

@@ -25,14 +25,10 @@
 #include "dasds.hpp"
 
 
-#ifdef _WIN32
-    #ifdef DFUXREFLIB_EXPORTS
-        #define DFUXREFNODEMANAGERLIB_API __declspec(dllexport)
-    #else
-        #define DFUXREFNODEMANAGERLIB_API __declspec(dllimport)
-    #endif
+#ifdef DFUXREFLIB_EXPORTS
+    #define DFUXREFNODEMANAGERLIB_API DECL_EXPORT
 #else
-    #define DFUXREFNODEMANAGERLIB_API
+    #define DFUXREFNODEMANAGERLIB_API DECL_IMPORT
 #endif
 
 

+ 3 - 7
dali/dfuXRefLib/dfuxreflib.hpp

@@ -18,14 +18,10 @@
 #ifndef DFUXREF_HPP
 #define DFUXREF_HPP
 
-#ifdef _WIN32
-    #ifdef DFUXREFLIB_EXPORTS
-        #define DFUXREFLIB_API __declspec(dllexport)
-    #else
-        #define DFUXREFLIB_API __declspec(dllimport)
-    #endif
+#ifdef DFUXREFLIB_EXPORTS
+    #define DFUXREFLIB_API DECL_EXPORT
 #else
-    #define DFUXREFLIB_API
+    #define DFUXREFLIB_API DECL_IMPORT
 #endif
 
 #include "XRefNodeManager.hpp"

+ 2 - 6
dali/ft/daft.hpp

@@ -18,14 +18,10 @@
 #ifndef DAFT_HPP
 #define DAFT_HPP
 
-#ifdef _WIN32
 #ifdef DALIFT_EXPORTS
-#define DALIFT_API __declspec(dllexport)
+#define DALIFT_API DECL_EXPORT
 #else
-#define DALIFT_API __declspec(dllimport)
-#endif
-#else
-#define DALIFT_API
+#define DALIFT_API DECL_IMPORT
 #endif
 
 #include "dadfs.hpp"

+ 2 - 6
dali/ft/ftbase.hpp

@@ -18,14 +18,10 @@
 #ifndef FTBASE_HPP
 #define FTBASE_HPP
 
-#ifdef _WIN32
 #ifdef DALIFT_EXPORTS
-#define DALIFT_API __declspec(dllexport)
+#define DALIFT_API DECL_EXPORT
 #else
-#define DALIFT_API __declspec(dllimport)
-#endif
-#else
-#define DALIFT_API
+#define DALIFT_API DECL_IMPORT
 #endif
 
 typedef __int32 crc32_t;

+ 1 - 1
dali/sasha/packetstore.cpp

@@ -1,4 +1,4 @@
-#define sa_decl __declspec(dllexport)
+#define sa_decl DECL_EXPORT
 #include "platform.h"
 #include "jlib.hpp"
 #include "jsuperhash.hpp"

+ 1 - 1
dali/sasha/packetstore.hpp

@@ -3,7 +3,7 @@
 
 
 #ifndef sa_decl
-#define sa_decl __declspec(dllimport)
+#define sa_decl DECL_IMPORT
 #endif
 
 #include "jlib.hpp"

+ 1 - 1
dali/sasha/saserver.cpp

@@ -20,7 +20,7 @@
 #include "thirdparty.h"
 #include "portlist.h"
 #include "jlib.hpp"
-#include "jlog.ipp"
+#include "jlog.hpp"
 #include "jptree.hpp"
 #include "jmisc.hpp"
 

+ 1 - 1
dali/security/dacaplib.cpp

@@ -17,7 +17,7 @@
 
 // Dali Authorization Capability Library
 #ifndef DACAP_LINKED_IN
-#define dacaplib_decl __declspec(dllexport)
+#define dacaplib_decl DECL_EXPORT
 #endif
 #include "platform.h"
 

+ 1 - 1
dali/security/dacaplib.hpp

@@ -35,7 +35,7 @@ extern  unsigned importDaliCapabilityXML_basic(const char *filename);
 #endif
 
 #ifndef dacaplib_decl
-#define dacaplib_decl __declspec(dllimport)
+#define dacaplib_decl DECL_IMPORT
 #endif
 
 

+ 6 - 0
dali/server/daserver.hpp

@@ -22,6 +22,12 @@
 #include "jiface.hpp"
 #include "mpbase.hpp"
 
+#ifdef DALI_EXPORTS
+#define da_decl DECL_EXPORT
+#else
+#define da_decl DECL_IMPORT
+#endif
+
 interface IDaliServer: extends IInterface  // for all coven based servers
 {
     virtual void start() = 0;

+ 2 - 2
deployment/configutils/confighelper.hpp

@@ -2,9 +2,9 @@
 #define CONFIGHELPER_HPP_INCL
 
 #ifdef CONFIGUTILS_EXPORTS
-  #define CONFIGUTILS_API __declspec(dllexport)
+  #define CONFIGUTILS_API DECL_EXPORT
 #else
-  #define CONFIGUTILS_API __declspec(dllimport)
+  #define CONFIGUTILS_API DECL_IMPORT
 #endif
 
 #define STANDARD_CONFIG_ALGORITHMFILE "genenvrules.conf"

+ 2 - 2
deployment/deploy/deploy.hpp

@@ -18,9 +18,9 @@
 #define DEPLOY_HPP_INCL
 
 #ifdef DEPLOY_EXPORTS
-  #define DEPLOY_API __declspec(dllexport)
+  #define DEPLOY_API DECL_EXPORT
 #else
-  #define DEPLOY_API __declspec(dllimport)
+  #define DEPLOY_API DECL_IMPORT
 #endif
 
 //disable the harmless warning about very long symbol names > 255 chars in debug mode

+ 2 - 2
deployment/deployutils/buildset.hpp

@@ -27,9 +27,9 @@
 #endif // _MSC_VER > 1000
 
 #ifdef DEPLOYUTILS_EXPORTS
-  #define DEPLOYUTILS_API __declspec(dllexport)
+  #define DEPLOYUTILS_API DECL_EXPORT
 #else
-  #define DEPLOYUTILS_API __declspec(dllimport)
+  #define DEPLOYUTILS_API DECL_IMPORT
 #endif
 
 interface IConstEnvironment;

+ 2 - 2
deployment/deployutils/deployutils.hpp

@@ -18,9 +18,9 @@
 #define DEPLOYUTILS_HPP_INCL
 
 #ifdef DEPLOYUTILS_EXPORTS
-  #define DEPLOYUTILS_API __declspec(dllexport)
+  #define DEPLOYUTILS_API DECL_EXPORT
 #else
-  #define DEPLOYUTILS_API __declspec(dllimport)
+  #define DEPLOYUTILS_API DECL_IMPORT
 #endif
 
 //disable the harmless warning about very long symbol names > 255 chars in debug mode

+ 3 - 6
ecl/hql/hql.hpp

@@ -17,15 +17,12 @@
 #ifndef _HQL_INCL
 #define _HQL_INCL
  
-#ifdef _WIN32
 #ifdef HQL_EXPORTS
-#define HQL_API __declspec(dllexport)
+#define HQL_API DECL_EXPORT
 #else
-#define HQL_API __declspec(dllimport)
-#endif
-#else
-#define HQL_API
+#define HQL_API DECL_IMPORT
 #endif
+
 #include "hqlatoms.hpp"
 #include "build-config.h"
 

+ 2 - 2
ecl/hql/hqlfold.hpp

@@ -18,9 +18,9 @@
 #define __HQLFOLD_HPP_
 
 #ifdef HQL_EXPORTS
-#define HQLFOLD_API __declspec(dllexport)
+#define HQLFOLD_API DECL_EXPORT
 #else
-#define HQLFOLD_API __declspec(dllimport)
+#define HQLFOLD_API DECL_IMPORT
 #endif
 
 #include "jlib.hpp"

+ 2 - 4
ecl/hqlcpp/hqlcatom.hpp

@@ -17,12 +17,10 @@
 #ifndef __HQLCATOM_HPP_
 #define __HQLCATOM_HPP_
 
-#ifdef _WIN32
 #ifdef HQLCPP_EXPORTS
-#define HQLCPP_API __declspec(dllexport)
+#define HQLCPP_API DECL_EXPORT
 #else
-#define HQLCPP_API __declspec(dllimport)
-#endif
+#define HQLCPP_API DECL_IMPORT
 #endif
 
 extern IAtom * _accessedFromChild_Atom;

+ 0 - 8
ecl/hqlcpp/hqlccommon.hpp

@@ -17,14 +17,6 @@
 #ifndef __HQLCCOMMON_HPP_
 #define __HQLCCOMMON_HPP_
 
-#ifdef _WIN32
-#ifdef HQLCPP_EXPORTS
-#define HQLCPP_API __declspec(dllexport)
-#else
-#define HQLCPP_API __declspec(dllimport)
-#endif
-#endif
-
 extern IHqlExpression * activeActivityMarkerExpr;
 extern IHqlExpression * activeFailureMarkerExpr;
 extern IHqlExpression * activeMatchTextExpr;

+ 2 - 2
ecl/hqlcpp/hqlcpp.hpp

@@ -18,9 +18,9 @@
 #define __HQLCPP_HPP_
 
 #ifdef HQLCPP_EXPORTS
-#define HQLCPP_API __declspec(dllexport)
+#define HQLCPP_API DECL_EXPORT
 #else
-#define HQLCPP_API __declspec(dllimport)
+#define HQLCPP_API DECL_IMPORT
 #endif
 
 #include "jlib.hpp"

+ 0 - 7
ecl/hqlcpp/hqlfunc.hpp

@@ -17,13 +17,6 @@
 #ifndef BUILDFUNC_HPP
 #define BUILDFUNC_HPP
 
-#ifdef READSCRIPT_EXPORTS
-#define READSCRIPT_DECL __declspec(dllexport)
-#else
-#define READSCRIPT_DECL __declspec(dllimport)
-#endif
-
-
 interface ITypeInfo;
 interface IFunctionParamInfo : public IInterface
 {

+ 2 - 2
ecl/hqlcpp/hqlpopt.hpp

@@ -18,9 +18,9 @@
 #define __HQLPOPT_HPP_
 
 #ifdef HQLCPP_EXPORTS
-#define HQLCPP_API __declspec(dllexport)
+#define HQLCPP_API DECL_EXPORT
 #else
-#define HQLCPP_API __declspec(dllimport)
+#define HQLCPP_API DECL_IMPORT
 #endif
 
 //Perform very late optimizations on expressions that could otherwise cause problems uncommoning attributes etc.

+ 2 - 2
ecl/hqlcpp/hqlstmt.hpp

@@ -18,9 +18,9 @@
 #define HQLSTMT_HPP
 
 #ifdef HQLCPP_EXPORTS
-#define HQLCPP_API __declspec(dllexport)
+#define HQLCPP_API DECL_EXPORT
 #else
-#define HQLCPP_API __declspec(dllimport)
+#define HQLCPP_API DECL_IMPORT
 #endif
 
 interface IHqlStmt;

+ 2 - 2
ecl/hqlcpp/hqlwcpp.hpp

@@ -18,9 +18,9 @@
 #define HQLWCPP_HPP
 
 #ifdef HQLCPP_EXPORTS
-#define HQLCPP_API __declspec(dllexport)
+#define HQLCPP_API DECL_EXPORT
 #else
-#define HQLCPP_API __declspec(dllimport)
+#define HQLCPP_API DECL_IMPORT
 #endif
 
 interface IHqlCppInstance;

+ 3 - 7
ecl/hthor/hthor.hpp

@@ -17,14 +17,10 @@
 #ifndef HTHOR_INCL
 #define HTHOR_INCL
 
-#ifdef _WIN32
 #ifdef HTHOR_EXPORTS
-#define HTHOR_API __declspec(dllexport)
+#define HTHOR_API DECL_EXPORT
 #else
-#define HTHOR_API __declspec(dllimport)
-#endif
-#else
-#define HTHOR_API
+#define HTHOR_API DECL_IMPORT
 #endif
 
 #include "eclhelper.hpp"
@@ -213,7 +209,7 @@ extern HTHOR_API IHThorActivity *createStreamedIteratorActivity(IAgentContext &,
 extern HTHOR_API IHThorActivity *createExternalActivity(IAgentContext &, unsigned _activityId, unsigned _subgraphId, IHThorExternalArg &arg, ThorActivityKind kind, IPropertyTree * graphNode);
 
 #define OwnedHThorRowArray OwnedRowArray
-class IHThorException : public IException
+class HTHOR_API IHThorException : public IException
 {
 };
 

+ 1 - 1
ecl/hthor/hthor.ipp

@@ -49,7 +49,7 @@ using roxiemem::DynamicRoxieOutputRowArray;
 
 //---------------------------------------------------------------------------
 
-class CHThorException : implements IHThorException, public CInterface
+class DECL_EXCEPTION CHThorException : implements IHThorException, public CInterface
 {
 public: 
     IMPLEMENT_IINTERFACE;

+ 2 - 2
ecl/schedulectrl/eventqueue.hpp

@@ -18,9 +18,9 @@
 #define __EVENTQUEUE_HPP_
 
 #ifdef SCHEDULECTRL_EXPORTS
-#define SCHEDULECTRL_API __declspec(dllexport)
+#define SCHEDULECTRL_API DECL_EXPORT
 #else
-#define SCHEDULECTRL_API __declspec(dllimport)
+#define SCHEDULECTRL_API DECL_IMPORT
 #endif
 
 #include "jexcept.hpp"

+ 2 - 2
ecl/schedulectrl/schedulectrl.hpp

@@ -18,9 +18,9 @@
 #define __SCHEDULECTRL_HPP_
 
 #ifdef SCHEDULECTRL_EXPORTS
-#define SCHEDULECTRL_API __declspec(dllexport)
+#define SCHEDULECTRL_API DECL_EXPORT
 #else
-#define SCHEDULECTRL_API __declspec(dllimport)
+#define SCHEDULECTRL_API DECL_IMPORT
 #endif
 
 #include "workunit.hpp"

+ 2 - 2
ecl/schedulectrl/scheduleread.hpp

@@ -18,9 +18,9 @@
 #define __SCHEDULEREAD_HPP_
 
 #ifdef SCHEDULECTRL_EXPORTS
-#define SCHEDULECTRL_API __declspec(dllexport)
+#define SCHEDULECTRL_API DECL_EXPORT
 #else
-#define SCHEDULECTRL_API __declspec(dllimport)
+#define SCHEDULECTRL_API DECL_IMPORT
 #endif
 
 #include "jstring.hpp"

+ 1 - 11
esp/bindings/SOAP/Platform/soapbind.cpp

@@ -17,12 +17,6 @@
 
 #pragma warning( disable : 4786 )
 
-#ifdef WIN32
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl __declspec(dllexport)
-#endif
-#endif
-
 //Jlib
 #include "jliball.hpp"
 
@@ -39,11 +33,7 @@
 #include "http/platform/httpservice.hpp"
 #include "SOAP/Platform/soapservice.hpp"
 
-#ifdef WIN32
-#define ESP_FACTORY __declspec(dllexport)
-#else
-#define ESP_FACTORY
-#endif
+#define ESP_FACTORY DECL_EXPORT
 
 CSoapBinding::CSoapBinding()
 {

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

@@ -18,14 +18,15 @@
 #ifndef _SOAPBIND_HPP__
 #define _SOAPBIND_HPP__
 
-#ifndef esp_http_decl
-    #define esp_http_decl
-#endif
-
-
 //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"

+ 0 - 7
esp/bindings/SOAP/Platform/soapmessage.cpp

@@ -17,13 +17,6 @@
 
 #pragma warning( disable : 4786)
 
-#ifdef WIN32
-#ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl __declspec(dllexport)
-#endif
-#endif
-
-
 //Jlib
 #include "jexcept.hpp"
 

+ 8 - 5
esp/bindings/SOAP/Platform/soapmessage.hpp

@@ -17,19 +17,22 @@
 
 #pragma warning( disable : 4786)
 
-#ifndef esp_http_decl
-    #define esp_http_decl
-#endif
-
-
 #ifndef _SOAPMESSAGE_HPP__
 #define _SOAPMESSAGE_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.hpp"
 
 #include <xpp/XmlPullParser.h>

+ 3 - 3
esp/bindings/SOAP/Platform/soapservice.cpp

@@ -17,10 +17,10 @@
 
 #pragma warning( disable : 4786)
 
-#ifdef WIN32
 #ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl __declspec(dllexport)
-#endif
+    #define esp_http_decl DECL_EXPORT
+#else
+    #define esp_http_decl DECL_IMPORT
 #endif
 
 //ESP Bindings

+ 4 - 3
esp/bindings/SOAP/client/soapclient.cpp

@@ -17,11 +17,12 @@
 
 #pragma warning( disable : 4786)
 
-#ifdef WIN32
 #ifdef ESPHTTP_EXPORTS
-    #define esp_http_decl __declspec(dllexport)
-#endif
+    #define esp_http_decl DECL_EXPORT
+#else
+    #define esp_http_decl DECL_IMPORT
 #endif
+
 #include <stdlib.h>
 
 //ESP Bindings

+ 0 - 4
esp/bindings/SOAP/client/soapclient.hpp

@@ -18,10 +18,6 @@
 #ifndef _SOAPCLIENT_HPP__
 #define _SOAPCLIENT_HPP__
 
-#ifndef esp_http_decl
-    #define esp_http_decl
-#endif
-
 //Jlib
 #include "jiface.hpp"
 

+ 1 - 0
esp/bindings/SOAP/soaplib/CMakeLists.txt

@@ -61,6 +61,7 @@ include_directories (
          ./../../../bindings/SOAP/xpp 
     )
 
+ADD_DEFINITIONS( -DESPHTTP_EXPORTS )
 
 if (WIN32)
     ADD_DEFINITIONS( -D_LIB )

+ 0 - 0
esp/bindings/bindutil.cpp


Some files were not shown because too many files changed in this diff