test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/redefclass005/redefclass005.cpp
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/redefclass005/redefclass005.cpp Wed Sep 12 14:19:36 2018 -0300
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/redefclass005/redefclass005.cpp Wed Sep 12 10:27:03 2018 -0700
@@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
-#ifdef __cplusplus
extern "C" {
-#endif
-
-#ifndef JNI_ENV_ARG
-#ifdef __cplusplus
-#define JNI_ENV_ARG(x, y) y
-#define JNI_ENV_PTR(x) x
-#else
-#define JNI_ENV_ARG(x,y) x, y
-#define JNI_ENV_PTR(x) (*x)
-#endif
-
-#endif
#define STATUS_FAILED 2
#define PASSED 0
@@ -119,8 +106,7 @@
jint res;
jvmtiError err;
- if ((res = JNI_ENV_PTR(vm)->GetEnv(JNI_ENV_ARG(vm, (void **) &jvmti),
- JVMTI_VERSION_1_1)) != JNI_OK) {
+ if ((res = vm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1)) != JNI_OK) {
printf("%s: Failed to call GetEnv: error=%d\n", __FILE__, res);
return JNI_ERR;
}
@@ -213,10 +199,8 @@
/* filling the structure jvmtiClassDefinition */
classDef.klass = redefCls;
- classDef.class_byte_count =
- JNI_ENV_PTR(env)->GetArrayLength(JNI_ENV_ARG(env, classBytes));
- classDef.class_bytes = (unsigned char *)
- JNI_ENV_PTR(env)->GetByteArrayElements(JNI_ENV_ARG(env, classBytes), NULL);
+ classDef.class_byte_count = env->GetArrayLength(classBytes);
+ classDef.class_bytes = (unsigned char *) env->GetByteArrayElements(classBytes, NULL);
set_watch_ev(1); /* watch JVMTI events */
@@ -250,6 +234,4 @@
return(result);
}
-#ifdef __cplusplus
}
-#endif