changeset 7231:2680adbe147a

8039118: Windows build failure (j2pcsc.dll : fatal error unresolved external symbol throwByName) Reviewed-by: mullan, mchung, alanb
author igerasim
date Sat, 31 May 2014 01:03:35 +0400
parents 69f00c5cfdf2
children 7522a66a366a
files src/share/native/sun/security/smartcardio/pcsc.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/security/smartcardio/pcsc.c	Sat May 31 01:02:25 2014 +0400
+++ b/src/share/native/sun/security/smartcardio/pcsc.c	Sat May 31 01:03:35 2014 +0400
@@ -64,10 +64,12 @@
 
 #define J2PCSC_EXCEPTION_NAME "sun/security/smartcardio/PCSCException"
 
-extern void throwByName(JNIEnv *, const char *, const char *);
+void throwOutOfMemoryError(JNIEnv *env, const char *msg) {
+    jclass cls = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
 
-void throwOutOfMemoryError(JNIEnv *env, const char *msg) {
-    throwByName(env, "java/lang/OutOfMemoryError", msg);
+    if (cls != NULL) /* Otherwise an exception has already been thrown */
+        (*env)->ThrowNew(env, cls, msg);
+
 }
 
 void throwPCSCException(JNIEnv* env, LONG code) {