Переглянути джерело

HPCC-7946 CATCH(expr,msg) won't compile

Rearrange jlib headers so that IException is not an opaque type.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 роки тому
батько
коміт
d1b9fe7060

+ 0 - 1
system/jlib/CMakeLists.txt

@@ -99,7 +99,6 @@ set (    INCLUDES
         jerror.hpp
         jerror.hpp
         jerrorrange.hpp
         jerrorrange.hpp
         jexcept.hpp
         jexcept.hpp
-        jexpdef.hpp
         jfile.hpp
         jfile.hpp
         jfile.ipp
         jfile.ipp
         jflz.hpp
         jflz.hpp

+ 0 - 1
system/jlib/jarray.hpp

@@ -23,7 +23,6 @@
 
 
 
 
 #include "platform.h"
 #include "platform.h"
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 
 
 typedef size32_t aindex_t;
 typedef size32_t aindex_t;

+ 1 - 1
system/jlib/javahash.hpp

@@ -20,7 +20,7 @@
 #ifndef JAVAHASH_HPP
 #ifndef JAVAHASH_HPP
 #define JAVAHASH_HPP
 #define JAVAHASH_HPP
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 #include "jlib.hpp"
 #include "jlib.hpp"
 #include "jobserve.hpp"
 #include "jobserve.hpp"
 #include "jiter.hpp"
 #include "jiter.hpp"

+ 0 - 2
system/jlib/jbroadcast.hpp

@@ -19,8 +19,6 @@
 #ifndef JBROADCAST_HPP
 #ifndef JBROADCAST_HPP
 #define JBROADCAST_HPP
 #define JBROADCAST_HPP
 
 
-
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 
 
 enum bctag_t
 enum bctag_t

+ 0 - 1
system/jlib/jbuff.hpp

@@ -20,7 +20,6 @@
 #ifndef JBUFF_HPP
 #ifndef JBUFF_HPP
 #define JBUFF_HPP
 #define JBUFF_HPP
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include "jmutex.hpp"
 #include "jmutex.hpp"
 #include "jmalloc.hpp"
 #include "jmalloc.hpp"

+ 1 - 1
system/jlib/jcrc.hpp

@@ -24,7 +24,7 @@
 
 
 #include "platform.h"
 #include "platform.h"
 #include <stdio.h>
 #include <stdio.h>
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 #include "jio.hpp"
 #include "jio.hpp"
 
 
 
 

+ 0 - 1
system/jlib/jdebug.hpp

@@ -20,7 +20,6 @@
 #ifndef JDEBUG_HPP
 #ifndef JDEBUG_HPP
 #define JDEBUG_HPP
 #define JDEBUG_HPP
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 
 
 #define TIMING
 #define TIMING

+ 1 - 1
system/jlib/jencrypt.hpp

@@ -20,7 +20,7 @@
 #define JENCRYPT_HPP
 #define JENCRYPT_HPP
 
 
 #include "platform.h"
 #include "platform.h"
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 #include "jbuff.hpp"
 #include "jbuff.hpp"
 #include "jexcept.hpp"
 #include "jexcept.hpp"
 
 

+ 0 - 25
system/jlib/jexcept.hpp

@@ -20,38 +20,13 @@
 #ifndef __JEXCEPT__
 #ifndef __JEXCEPT__
 #define __JEXCEPT__
 #define __JEXCEPT__
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include "jlib.hpp"
 #include "jlib.hpp"
 #include "errno.h"
 #include "errno.h"
 
 
-// When changing this enum, be sure to update (a) the string functions, and (b) NUM value in jlog.hpp
-
-typedef enum
-{
-    MSGAUD_unknown     = 0x00,
-    MSGAUD_operator    = 0x01,
-    MSGAUD_user        = 0x02,
-    MSGAUD_monitor     = 0x04,
-    MSGAUD_performance = 0x08,
-    MSGAUD_internal    = 0x10,
-    MSGAUD_programmer  = 0x20,
-    MSGAUD_legacy      = 0x40,
-    MSGAUD_audit       = 0x80,
-    MSGAUD_all         = 0xFF
-} MessageAudience;
-
 jlib_decl const char* SerializeMessageAudience(MessageAudience ma);
 jlib_decl const char* SerializeMessageAudience(MessageAudience ma);
 jlib_decl MessageAudience DeserializeMessageAudience(const char* text);
 jlib_decl MessageAudience DeserializeMessageAudience(const char* text);
 
 
-
-interface jlib_thrown_decl IException : public IInterface
-{
-    virtual int             errorCode() const = 0;
-    virtual StringBuffer &  errorMessage(StringBuffer &msg) const = 0;
-    virtual MessageAudience errorAudience() const = 0;
-};
-
 //the following interface to be thrown when a user command explicitly calls for a failure
 //the following interface to be thrown when a user command explicitly calls for a failure
 
 
 interface jlib_thrown_decl IUserException : public IException
 interface jlib_thrown_decl IUserException : public IException

+ 0 - 35
system/jlib/jexpdef.hpp

@@ -1,35 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-
-#ifdef _WIN32
- #ifdef JLIB_EXPORTS
-  #define jlib_decl __declspec(dllexport)
-  #define jlib_thrown_decl __declspec(dllexport)
- #else
-  #define jlib_decl __declspec(dllimport)
-  #define jlib_thrown_decl __declspec(dllimport)
- #endif
-#else
-#if __GNUC__ >= 4
-  #define jlib_decl  __attribute__ ((visibility("default")))
-  #define jlib_thrown_decl __attribute__ ((visibility("default")))
-#else
- #define jlib_decl
- #define jlib_thrown_decl 
-#endif
-#endif

+ 0 - 1
system/jlib/jhash.hpp

@@ -22,7 +22,6 @@
 
 
 #include "platform.h"
 #include "platform.h"
 #include <stdio.h>
 #include <stdio.h>
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include "jobserve.hpp"
 #include "jobserve.hpp"
 #include "jiter.hpp"
 #include "jiter.hpp"

+ 1 - 1
system/jlib/jhash.ipp

@@ -21,7 +21,7 @@
 #define JHASH_IPP
 #define JHASH_IPP
 
 
 #include "platform.h"
 #include "platform.h"
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 #include "jobserve.ipp"
 #include "jobserve.ipp"
 
 
 #ifdef _WIN32
 #ifdef _WIN32

+ 1 - 4
system/jlib/jheap.hpp

@@ -19,10 +19,7 @@
 #ifndef JHEAP_HPP
 #ifndef JHEAP_HPP
 #define JHEAP_HPP
 #define JHEAP_HPP
 
 
-#include "jexpdef.hpp"
-
-//jlib_decl void * operator new (size32_t len);
-//jlib_decl void operator delete(void * data);
+#include "jiface.hpp"
 
 
 jlib_decl void * chunkedNew(size32_t len);
 jlib_decl void * chunkedNew(size32_t len);
 jlib_decl void chunkedFree(void * data);
 jlib_decl void chunkedFree(void * data);

+ 0 - 1
system/jlib/jiface.hpp

@@ -23,7 +23,6 @@
 
 
 #include "platform.h"
 #include "platform.h"
 #include <string.h>
 #include <string.h>
-#include "jexpdef.hpp"
 #include "jscm.hpp"
 #include "jscm.hpp"
 #include "jatomic.hpp"
 #include "jatomic.hpp"
 
 

+ 1 - 1
system/jlib/jisem.hpp

@@ -19,7 +19,7 @@
 #ifndef __JISEM__
 #ifndef __JISEM__
 #define __JISEM__
 #define __JISEM__
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 #include "jsem.hpp"
 #include "jsem.hpp"
 #include "jmutex.hpp"
 #include "jmutex.hpp"
 #include "jexcept.hpp"
 #include "jexcept.hpp"

+ 0 - 1
system/jlib/jiter.hpp

@@ -20,7 +20,6 @@
 #ifndef JITER_HPP
 #ifndef JITER_HPP
 #define JITER_HPP
 #define JITER_HPP
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 
 
 
 

+ 0 - 4
system/jlib/jlib.hpp

@@ -20,11 +20,8 @@
 #ifndef JLIB_HPP
 #ifndef JLIB_HPP
 #define JLIB_HPP
 #define JLIB_HPP
 
 
-#include "jexpdef.hpp"
-
 #define EXPLICIT_INIT
 #define EXPLICIT_INIT
 
 
-
 #ifdef _MSC_VER
 #ifdef _MSC_VER
 //disable these throughout the system because they occur a lot
 //disable these throughout the system because they occur a lot
 #pragma warning(disable : 4275 ) // should get link errors if something is wrong...
 #pragma warning(disable : 4275 ) // should get link errors if something is wrong...
@@ -33,7 +30,6 @@
 #pragma warning(disable : 4355 ) // 'this' : used in base member initializer list 
 #pragma warning(disable : 4355 ) // 'this' : used in base member initializer list 
 #endif
 #endif
 
 
-
 #include "modinit.h"
 #include "modinit.h"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include <assert.h>
 #include <assert.h>

+ 0 - 1
system/jlib/jlog.hpp

@@ -29,7 +29,6 @@
 
 
 #include "stdio.h"
 #include "stdio.h"
 #include "time.h"
 #include "time.h"
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include "jlib.hpp"
 #include "jlib.hpp"
 #include "jexcept.hpp"
 #include "jexcept.hpp"

+ 0 - 1
system/jlib/jmalloc.hpp

@@ -19,7 +19,6 @@
 #ifndef JMALLOC_HPP
 #ifndef JMALLOC_HPP
 #define JMALLOC_HPP
 #define JMALLOC_HPP
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 
 
 interface IAllocator: extends IInterface
 interface IAllocator: extends IInterface

+ 1 - 1
system/jlib/jmd5.hpp

@@ -68,7 +68,7 @@
 #ifndef md5_INCLUDED
 #ifndef md5_INCLUDED
 #  define md5_INCLUDED
 #  define md5_INCLUDED
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 
 
 /*
 /*
  * This package supports both compile-time and run-time determination of CPU
  * This package supports both compile-time and run-time determination of CPU

+ 0 - 1
system/jlib/jmisc.hpp

@@ -22,7 +22,6 @@
 
 
 #include "platform.h"
 #include "platform.h"
 #include <stdio.h>
 #include <stdio.h>
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include "jcrc.hpp"
 #include "jcrc.hpp"
 #include "jlog.hpp"
 #include "jlog.hpp"

+ 0 - 1
system/jlib/jmutex.hpp

@@ -22,7 +22,6 @@
 
 
 
 
 #include <assert.h>
 #include <assert.h>
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include "jsem.hpp"
 #include "jsem.hpp"
 
 

+ 0 - 1
system/jlib/jobserve.hpp

@@ -20,7 +20,6 @@
 #ifndef JOBSERVE_HPP
 #ifndef JOBSERVE_HPP
 #define JOBSERVE_HPP
 #define JOBSERVE_HPP
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 
 
 interface IObservable;
 interface IObservable;

+ 0 - 1
system/jlib/jptree.hpp

@@ -19,7 +19,6 @@
 #ifndef _PTREE_HPP
 #ifndef _PTREE_HPP
 #define _PTREE_HPP
 #define _PTREE_HPP
 
 
-#include "jexpdef.hpp"
 #include "jlib.hpp"
 #include "jlib.hpp"
 #include "jexcept.hpp"
 #include "jexcept.hpp"
 #include "jiter.hpp"
 #include "jiter.hpp"

+ 1 - 1
system/jlib/jregexp.hpp

@@ -22,7 +22,7 @@
 
 
 #include <limits.h>
 #include <limits.h>
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 #include "jstring.hpp"
 #include "jstring.hpp"
 
 
 /*********************** Regular Expression Class ***********************/
 /*********************** Regular Expression Class ***********************/

+ 41 - 2
system/jlib/jscm.hpp

@@ -24,9 +24,23 @@
 #define extends      public
 #define extends      public
 
 
 #ifdef _MSC_VER
 #ifdef _MSC_VER
-#define interface    struct __declspec(novtable)
+ #define interface    struct __declspec(novtable)
+ #ifdef JLIB_EXPORTS
+  #define jlib_decl __declspec(dllexport)
+  #define jlib_thrown_decl __declspec(dllexport)
+ #else
+  #define jlib_decl __declspec(dllimport)
+  #define jlib_thrown_decl __declspec(dllimport)
+ #endif
 #else
 #else
-#define interface    struct 
+ #define interface    struct
+ #if __GNUC__ >= 4
+  #define jlib_decl  __attribute__ ((visibility("default")))
+  #define jlib_thrown_decl __attribute__ ((visibility("default")))
+ #else
+  #define jlib_decl
+  #define jlib_thrown_decl
+ #endif
 #endif
 #endif
 
 
 interface IInterface
 interface IInterface
@@ -200,4 +214,29 @@ template <class X> inline X * LINK(X * ptr)     { if (ptr) ptr->Link(); return p
 template <class X> inline X & OLINK(X & obj)        { obj.Link(); return obj; }
 template <class X> inline X & OLINK(X & obj)        { obj.Link(); return obj; }
 template <class X> inline X * LINK(const Shared<X> &ptr) { return ptr.getLink(); }
 template <class X> inline X * LINK(const Shared<X> &ptr) { return ptr.getLink(); }
 
 
+class StringBuffer;
+
+// When changing this enum, be sure to update (a) the string functions, and (b) NUM value in jlog.hpp
+
+typedef enum
+{
+    MSGAUD_unknown     = 0x00,
+    MSGAUD_operator    = 0x01,
+    MSGAUD_user        = 0x02,
+    MSGAUD_monitor     = 0x04,
+    MSGAUD_performance = 0x08,
+    MSGAUD_internal    = 0x10,
+    MSGAUD_programmer  = 0x20,
+    MSGAUD_legacy      = 0x40,
+    MSGAUD_audit       = 0x80,
+    MSGAUD_all         = 0xFF
+} MessageAudience;
+
+interface jlib_thrown_decl IException : public IInterface
+{
+    virtual int             errorCode() const = 0;
+    virtual StringBuffer &  errorMessage(StringBuffer &msg) const = 0;
+    virtual MessageAudience errorAudience() const = 0;
+};
+
 #endif
 #endif

+ 1 - 1
system/jlib/jsem.hpp

@@ -20,7 +20,7 @@
 #ifndef __JSEM__
 #ifndef __JSEM__
 #define __JSEM__
 #define __JSEM__
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 
 
 #ifdef _WIN32
 #ifdef _WIN32
 
 

+ 1 - 1
system/jlib/jset.hpp

@@ -20,7 +20,7 @@
 #ifndef __JSET__
 #ifndef __JSET__
 #define __JSET__
 #define __JSET__
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 
 
 
 
 
 

+ 1 - 1
system/jlib/jsocket.hpp

@@ -26,7 +26,7 @@
 #include <time.h>
 #include <time.h>
 #endif
 #endif
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 #include "jexcept.hpp"
 #include "jexcept.hpp"
 #include "jthread.hpp"
 #include "jthread.hpp"
 
 

+ 1 - 1
system/jlib/jsort.hpp

@@ -20,7 +20,7 @@
 #ifndef JSORT_HPP
 #ifndef JSORT_HPP
 #define JSORT_HPP
 #define JSORT_HPP
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 #include "jio.hpp"
 #include "jio.hpp"
 
 
 #ifndef ICOMPARE_DEFINED
 #ifndef ICOMPARE_DEFINED

+ 1 - 1
system/jlib/jsorta.hpp

@@ -21,7 +21,7 @@
 #define JSORTARR_HPP
 #define JSORTARR_HPP
 
 
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 #include "jsort.hpp"
 #include "jsort.hpp"
 
 
 
 

+ 0 - 1
system/jlib/jstream.hpp

@@ -20,7 +20,6 @@
 #ifndef JSTREAM_HPP
 #ifndef JSTREAM_HPP
 #define JSTREAM_HPP
 #define JSTREAM_HPP
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 class StringBuffer;
 class StringBuffer;
 
 

+ 0 - 1
system/jlib/jstring.hpp

@@ -20,7 +20,6 @@
 #ifndef __JSTRING__
 #ifndef __JSTRING__
 #define __JSTRING__
 #define __JSTRING__
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include "jio.hpp"
 #include "jio.hpp"
 #include "jstream.hpp"
 #include "jstream.hpp"

+ 0 - 1
system/jlib/jsuperhash.hpp

@@ -23,7 +23,6 @@
 //#define TRACE_HASH
 //#define TRACE_HASH
 #undef expand
 #undef expand
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include "jiter.hpp"
 #include "jiter.hpp"
 #include "jstring.hpp"
 #include "jstring.hpp"

+ 0 - 1
system/jlib/jthread.hpp

@@ -20,7 +20,6 @@
 #ifndef __JTHREAD__
 #ifndef __JTHREAD__
 #define __JTHREAD__
 #define __JTHREAD__
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 #include "jmutex.hpp"
 #include "jmutex.hpp"
 #include "jexcept.hpp"
 #include "jexcept.hpp"

+ 0 - 1
system/jlib/jtime.hpp

@@ -19,7 +19,6 @@
 #ifndef JTIME_HPP
 #ifndef JTIME_HPP
 #define JTIME_HPP
 #define JTIME_HPP
 
 
-#include "jexpdef.hpp"
 #include "jlib.hpp"
 #include "jlib.hpp"
 
 
 #include "jiface.hpp"
 #include "jiface.hpp"

+ 1 - 1
system/jlib/junicode.hpp

@@ -18,7 +18,7 @@
 #ifndef JUNICODE_HPP
 #ifndef JUNICODE_HPP
 #define JUNICODE_HPP
 #define JUNICODE_HPP
 
 
-#include "jexpdef.hpp"
+#include "jiface.hpp"
 
 
 class StringMatcher;
 class StringMatcher;
 
 

+ 0 - 1
system/jlib/jutil.hpp

@@ -20,7 +20,6 @@
 #define JUTIL_HPP
 #define JUTIL_HPP
 
 
 #include "jlib.hpp"
 #include "jlib.hpp"
-#include "jexpdef.hpp"
 #include "jstring.hpp"
 #include "jstring.hpp"
 #include "jarray.tpp"
 #include "jarray.tpp"
 #include "jbuff.hpp"
 #include "jbuff.hpp"

+ 0 - 1
system/jlib/jvmem.hpp

@@ -19,7 +19,6 @@
 #ifndef JVMEM_HPP
 #ifndef JVMEM_HPP
 #define JVMEM_HPP
 #define JVMEM_HPP
 
 
-#include "jexpdef.hpp"
 #include "jiface.hpp"
 #include "jiface.hpp"
 
 
 interface IVMAllocator: extends IInterface
 interface IVMAllocator: extends IInterface