changeset 23013:1cf3dddf9ff7

8035640: JNU_CHECK_EXCEPTION should support c++ JNI syntax Reviewed-by: anthony, alanb
author pchelko
date Tue, 25 Feb 2014 11:51:25 +0400
parents b952c2b46e0d
children af8145529dd4
files jdk/src/share/native/common/jni_util.h
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/native/common/jni_util.h	Mon Feb 24 22:43:45 2014 -0800
+++ b/jdk/src/share/native/common/jni_util.h	Tue Feb 25 11:51:25 2014 +0400
@@ -297,6 +297,21 @@
         }                                       \
     } while (0)                                 \
 
+#ifdef __cplusplus
+#define JNU_CHECK_EXCEPTION(env)                \
+    do {                                        \
+        if ((env)->ExceptionCheck()) {          \
+            return;                             \
+        }                                       \
+    } while (0)                                 \
+
+#define JNU_CHECK_EXCEPTION_RETURN(env, y)      \
+    do {                                        \
+        if ((env)->ExceptionCheck()) {          \
+            return (y);                         \
+        }                                       \
+    } while (0)
+#else
 #define JNU_CHECK_EXCEPTION(env)                \
     do {                                        \
         if ((*env)->ExceptionCheck(env)) {      \
@@ -310,7 +325,7 @@
             return (y);                         \
         }                                       \
     } while (0)
-
+#endif /* __cplusplus */
 /************************************************************************
  * Debugging utilities
  */