Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
12
Description
A lot tests are trying to serve C and C++ and therefore do things like:
#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
This leads to less-than-ideal readable code such as:
return JNI_ENV_PTR(env)->ThrowNew(JNI_ENV_ARG(env, exc_class), msg);
We can clean up these macros since now cpp or c test files are compiled by one or the other languages and this will help readability of the actual tests.
Other macros to clean up:
JVMTI_ENV*
And remove the #ifdef __cplusplus parts.
#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
This leads to less-than-ideal readable code such as:
return JNI_ENV_PTR(env)->ThrowNew(JNI_ENV_ARG(env, exc_class), msg);
We can clean up these macros since now cpp or c test files are compiled by one or the other languages and this will help readability of the actual tests.
Other macros to clean up:
JVMTI_ENV*
And remove the #ifdef __cplusplus parts.
Attachments
Issue Links
- relates to
-
JDK-8209611 use C++ compiler for hotspot tests
- Resolved