8035640: JNU_CHECK_EXCEPTION should support c++ JNI syntax
Reviewed-by: anthony, alanb
--- 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
*/