8255128: linux x86 build failure with libJNIPoint.c

Reviewed-by: coleenp, shade, ihse
This commit is contained in:
Jorn Vernee 2020-11-04 18:10:49 +00:00
parent 160759ceef
commit 804bd72599
2 changed files with 11 additions and 16 deletions

View File

@ -663,16 +663,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DARCH='\"$FLAGS_CPU_LEGACY\"' \
-D$FLAGS_CPU_LEGACY"
if test "x$FLAGS_CPU_BITS" = x64; then
# -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
# unpack200.exe.
if test "x$FLAGS_OS" = xlinux || test "x$FLAGS_OS" = xmacosx; then
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1"
fi
if test "x$FLAGS_OS" != xaix; then
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it.
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1"
fi
if test "x$FLAGS_CPU_BITS" = x64 && test "x$FLAGS_OS" != xaix; then
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it.
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1"
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1"
fi
# toolchain dependend, per-cpu

View File

@ -22,40 +22,41 @@
*/
#include <jni.h>
#include <stdlib.h>
#include "jlong.h"
#include "points.h"
JNIEXPORT jlong JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_allocate
(JNIEnv *env, jclass nativePointClass) {
Point* p = malloc(sizeof *p);
return (jlong) p;
return ptr_to_jlong(p);
}
JNIEXPORT void JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_free
(JNIEnv *env, jclass cls, jlong thisPoint) {
free((Point*) thisPoint);
free(jlong_to_ptr(thisPoint));
}
JNIEXPORT jint JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_getX
(JNIEnv *env, jclass cls, jlong thisPoint) {
Point* point = (Point*) thisPoint;
Point* point = jlong_to_ptr(thisPoint);
return point->x;
}
JNIEXPORT void JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_setX
(JNIEnv *env, jclass cls, jlong thisPoint, jint value) {
Point* point = (Point*) thisPoint;
Point* point = jlong_to_ptr(thisPoint);
point->x = value;
}
JNIEXPORT jint JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_getY
(JNIEnv *env, jclass cls, jlong thisPoint) {
Point* point = (Point*) thisPoint;
Point* point = jlong_to_ptr(thisPoint);
return point->y;
}
JNIEXPORT void JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_setY
(JNIEnv *env, jclass cls, jlong thisPoint, jint value) {
Point* point = (Point*) thisPoint;
Point* point = jlong_to_ptr(thisPoint);
point->y = value;
}