[[[
    JavaHL: Added SVN_JNI_INPUT_STREAM macro to reduce amount of duplicate
code dealing with InputStream wrapper and checking for exceptions

    [ in subversion/bindings/javahl/native ]

    * InputStream.h
      (SVN_JNI_INPUT_STREAM): New macro to declare local variable of type
InputStream and return in case of exceptions
]]]
Index: subversion/bindings/javahl/native/InputStream.h
===================================================================
--- subversion/bindings/javahl/native/InputStream.h     (revision 1328758)
+++ subversion/bindings/javahl/native/InputStream.h     (working copy)
@@ -50,4 +50,13 @@ class InputStream
   svn_stream_t *getStream(const SVN::Pool &pool);
 };
 
+#define SVN_JNI_INPUT_STREAM(localName, jname, ret_val)     \
+InputStream localName(jname);                               \
+do {                                                        \
+  if (JNIUtil::isExceptionThrown())                         \
+    {                                                       \
+      return ret_val ;                                      \
+    }                                                       \
+} while (0)
+
 #endif // INPUT_STREAM_H

Reply via email to