diff --git a/CHANGELOG.md b/CHANGELOG.md index 71e83220c..ea9b55824 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Prevent `Builder` unnecessarily linking with `-framework JavaVM` to fix GraalVM Native Image on Mac ([issue #417](https://github.com/bytedeco/javacpp/issues/417)) * Add `Pointer.getPointer()` methods as shortcuts for `new P(p).position(p.position + i)` ([issue #155](https://github.com/bytedeco/javacpp/issues/155)) * Fix `Generator` for cases when a `FunctionPointer` returns another `FunctionPointer` * Fix `Parser` failure with `auto` keyword of C++11 used as placeholder type specifier or for trailing return type ([issue #407](https://github.com/bytedeco/javacpp/issues/407)) diff --git a/src/main/java/org/bytedeco/javacpp/Pointer.java b/src/main/java/org/bytedeco/javacpp/Pointer.java index 29100550a..7b8bb4ffa 100644 --- a/src/main/java/org/bytedeco/javacpp/Pointer.java +++ b/src/main/java/org/bytedeco/javacpp/Pointer.java @@ -847,12 +847,12 @@ public Buffer asBuffer() { public static native Pointer memset(Pointer dst, int ch, long size); /** Returns {@code getPointer(0)}. */ - public Pointer getPointer() { + public
P getPointer() { return getPointer(0); } /** Returns {@code new Pointer(this).position((position + i) * sizeof()).capacity(capacity * sizeof()).limit(limit * sizeof())}. */ - public Pointer getPointer(long i) { + public
P getPointer(long i) { long s = sizeof(); return new Pointer(this).position((position + i) * s).capacity(capacity * s).limit(limit *s); } diff --git a/src/main/java/org/bytedeco/javacpp/tools/Builder.java b/src/main/java/org/bytedeco/javacpp/tools/Builder.java index af29a0604..3de80284d 100644 --- a/src/main/java/org/bytedeco/javacpp/tools/Builder.java +++ b/src/main/java/org/bytedeco/javacpp/tools/Builder.java @@ -198,9 +198,9 @@ void includeJavaPaths(ClassProperties properties, boolean header) { // We only need libjvm for callbacks exported with the header file properties.get("platform.link").add(0, "jvm"); properties.addAll("platform.linkpath", jvmpath); - } - if (platform.startsWith("macosx")) { - properties.addAll("platform.framework", "JavaVM"); + if (platform.startsWith("macosx")) { + properties.addAll("platform.framework", "JavaVM"); + } } } }