8039118: Windows build failure (j2pcsc.dll : fatal error unresolved external symbol throwByName)
Reviewed-by: mullan, mchung, alanb
--- a/jdk/src/share/native/sun/security/smartcardio/pcsc.c Wed Apr 02 11:03:10 2014 -0400
+++ b/jdk/src/share/native/sun/security/smartcardio/pcsc.c Wed Apr 02 23:23:00 2014 +0100
@@ -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) {