diff options
Diffstat (limited to 'subversion/bindings/javahl/native/JNIUtil.h')
-rw-r--r-- | subversion/bindings/javahl/native/JNIUtil.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/subversion/bindings/javahl/native/JNIUtil.h b/subversion/bindings/javahl/native/JNIUtil.h index f122556..d353984 100644 --- a/subversion/bindings/javahl/native/JNIUtil.h +++ b/subversion/bindings/javahl/native/JNIUtil.h @@ -41,6 +41,8 @@ struct svn_error_t; #define JAVA_PACKAGE "org/apache/subversion/javahl" +struct svn_string_t; + /** * Class to hold a number of JNI related utility methods. No Objects * of this class are ever created. @@ -62,7 +64,8 @@ class JNIUtil int aprErr = -1); static void throwNullPointerException(const char *message); - static jbyteArray makeJByteArray(const signed char *data, int length); + static jbyteArray makeJByteArray(const void *data, int length); + static jbyteArray makeJByteArray(const svn_string_t *str); static jobject createDate(apr_time_t time); static void logMessage(const char *message); static int getLogLevel(); @@ -138,6 +141,7 @@ class JNIUtil enum { noLog, errorLog, exceptionLog, entryLog } LogLevel; private: + static void wrappedHandleSVNError(svn_error_t *err); static void assembleErrorMessage(svn_error_t *err, int depth, apr_status_t parent_apr_err, std::string &buffer); @@ -214,9 +218,9 @@ class JNIUtil */ #define SVN_JNI_NULL_PTR_EX(expr, str, ret_val) \ - if (expr == NULL) { \ + if ((expr) == NULL) { \ JNIUtil::throwNullPointerException(str); \ - return ret_val ; \ + return ret_val; \ } /** @@ -235,7 +239,7 @@ class JNIUtil svn_error_t *svn_jni_err__temp = (expr); \ if (svn_jni_err__temp != SVN_NO_ERROR) { \ JNIUtil::handleSVNError(svn_jni_err__temp); \ - return ret_val ; \ + return ret_val; \ } \ } while (0) @@ -251,7 +255,7 @@ class JNIUtil do \ { \ env->PopLocalFrame(NULL); \ - return ret_val ; \ + return ret_val; \ } \ while (0) @@ -272,4 +276,12 @@ class JNIUtil */ #define POP_AND_RETURN_NULL POP_AND_RETURN(NULL) +#define CPPADDR_NULL_PTR(expr, ret_val) \ + do { \ + if ((expr) == NULL) { \ + JNIUtil::throwError(_("bad C++ this")); \ + return ret_val; \ + } \ + } while (0) + #endif // JNIUTIL_H |