test/hotspot/jtreg/vmTestbase/nsk/jvmti/RawMonitorNotifyAll/rawmnntfyall004/rawmnntfyall004.cpp
changeset 51715 13a63d4a3f8d
parent 51551 e409244ce72e
equal deleted inserted replaced
51714:975d3636a2f9 51715:13a63d4a3f8d
    25 #include <string.h>
    25 #include <string.h>
    26 #include "jvmti.h"
    26 #include "jvmti.h"
    27 #include "agent_common.h"
    27 #include "agent_common.h"
    28 #include "JVMTITools.h"
    28 #include "JVMTITools.h"
    29 
    29 
    30 #ifdef __cplusplus
       
    31 extern "C" {
    30 extern "C" {
    32 #endif
       
    33 
    31 
    34 #ifndef JNI_ENV_ARG
       
    35 
       
    36 #ifdef __cplusplus
       
    37 #define JNI_ENV_ARG(x, y) y
       
    38 #define JNI_ENV_PTR(x) x
       
    39 #else
       
    40 #define JNI_ENV_ARG(x,y) x, y
       
    41 #define JNI_ENV_PTR(x) (*x)
       
    42 #endif
       
    43 
       
    44 #endif
       
    45 
    32 
    46 #define PASSED 0
    33 #define PASSED 0
    47 #define STATUS_FAILED 2
    34 #define STATUS_FAILED 2
    48 
    35 
    49 static jvmtiEnv *jvmti = NULL;
    36 static jvmtiEnv *jvmti = NULL;
    66 
    53 
    67     if (options != NULL && strcmp(options, "printdump") == 0) {
    54     if (options != NULL && strcmp(options, "printdump") == 0) {
    68         printdump = JNI_TRUE;
    55         printdump = JNI_TRUE;
    69     }
    56     }
    70 
    57 
    71     res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
    58     res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
    72         JVMTI_VERSION_1_1);
       
    73     if (res != JNI_OK || jvmti == NULL) {
    59     if (res != JNI_OK || jvmti == NULL) {
    74         printf("Wrong result of a valid call to GetEnv!\n");
    60         printf("Wrong result of a valid call to GetEnv!\n");
    75         return JNI_ERR;
    61         return JNI_ERR;
    76     }
    62     }
    77 
    63 
   111     }
    97     }
   112 
    98 
   113     return result;
    99     return result;
   114 }
   100 }
   115 
   101 
   116 #ifdef __cplusplus
       
   117 }
   102 }
   118 #endif