< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/OnUnload/JvmtiTest/JvmtiTest.cpp

Print this page
rev 51722 : 8210700: Clean up JNI_ENV_ARG and factorize the macros for vmTestbase/jvmti/unit tests
Summary:
Reviewed-by:

*** 24,50 **** #include <stdio.h> #include <string.h> #include "jvmti.h" #include "agent_common.h" - #ifdef __cplusplus extern "C" { - #endif - #ifndef JNI_ENV_ARG - - #ifdef __cplusplus - #define JNI_ENV_ARG(x, y) y - #define JNI_ENV_ARG1(x) - #define JNI_ENV_PTR(x) x - #else - #define JNI_ENV_ARG(x,y) x, y - #define JNI_ENV_ARG1(x) x - #define JNI_ENV_PTR(x) (*x) - #endif - - #endif jvmtiEnv *jvmti; #ifdef STATIC_BUILD --- 24,35 ----
*** 59,70 **** } #endif jint Agent_Initialize(JavaVM * jvm, char *options, void *reserved) { jint res; ! res = JNI_ENV_PTR(jvm)-> ! GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti), JVMTI_VERSION_1_1); if (res < 0) { printf("Wrong result of a valid call to GetEnv!\n"); return JNI_ERR; } --- 44,54 ---- } #endif jint Agent_Initialize(JavaVM * jvm, char *options, void *reserved) { jint res; ! res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1); if (res < 0) { printf("Wrong result of a valid call to GetEnv!\n"); return JNI_ERR; }
*** 81,88 **** { printf("Success -- called Agent_OnUnload\n"); } - #ifdef __cplusplus } - #endif --- 65,70 ----
< prev index next >