subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v...@apache.org
Subject svn commit: r1344977 - /subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h
Date Fri, 01 Jun 2012 03:10:46 GMT
Author: vmpn
Date: Fri Jun  1 03:10:46 2012
New Revision: 1344977

URL: http://svn.apache.org/viewvc?rev=1344977&view=rev
Log:
JavaHL: Added CPPADDR_NULL_PTR macro to reduce amount of duplicate code
checking C++ pointer extracted from the java object

[ in subversion/bindings/javahl/native ]

* JNIUtil.h
  (CPPADDR_NULL_PTR): New macro to test for NULL pointer and raise java
    exception if necessary

Approved by: gstein

Modified:
    subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h?rev=1344977&r1=1344976&r2=1344977&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h Fri Jun  1 03:10:46
2012
@@ -273,4 +273,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



Mime
View raw message