src/share/native/common/jni_util.h

Print this page

        

@@ -295,10 +295,25 @@
         if ((x) == NULL) {                      \
             return (y);                         \
         }                                       \
     } 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)) {      \
             return;                             \
         }                                       \

@@ -308,11 +323,11 @@
     do {                                        \
         if ((*env)->ExceptionCheck(env)) {      \
             return (y);                         \
         }                                       \
     } while (0)
-
+#endif /* __cplusplus */
 /************************************************************************
  * Debugging utilities
  */
 
 JNIEXPORT void JNICALL