Skip to content

Commit

Permalink
* Fix inconsistencies when using `@Platform(inherit=..., library=...…
Browse files Browse the repository at this point in the history
…)` together (pull #747)
  • Loading branch information
saudet committed Mar 16, 2024
1 parent 9940c31 commit b3bda85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,4 +1,5 @@

* Fix inconsistencies when using `@Platform(inherit=..., library=...)` together ([pull #747](https://github.com/bytedeco/javacpp/pull/747))
* Let `Parser` support templates with unnamed type parameters ([pull #742](https://github.com/bytedeco/javacpp/pull/742))
* Prevent `Parser` from producing duplicate declarations for basic containers ([pull #741](https://github.com/bytedeco/javacpp/pull/741))

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/bytedeco/javacpp/ClassProperties.java
Expand Up @@ -313,7 +313,9 @@ public void load(Class cls, boolean inherit) {
}
addAll("platform.executablepath", executablepath);
addAll("platform.executable", executable);
setProperty("platform.library", library);
if (hasPlatformProperties || getProperty("platform.library", "").length() == 0) {
setProperty("platform.library", library);
}

if (LoadEnabled.class.isAssignableFrom(c)) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/bytedeco/javacpp/tools/Generator.java
Expand Up @@ -812,7 +812,7 @@ boolean classes(boolean handleExceptions, boolean defineAdapters, boolean conver
out.println("static JavaCPP_noinline jclass JavaCPP_getClass(JNIEnv* env, int i);");
out.println("static inline void JavaCPP_loadGlobal(JNIEnv* env, jclass cls, const char* filename) {");
out.println("#ifdef _WIN32");
out.println(" HMODULE handle = LoadLibrary(filename);");
out.println(" HMODULE handle = LoadLibraryA(filename);");
out.println(" if (handle == NULL) {");
out.println(" char temp[256];");
out.println(" sprintf(temp, \"LoadLibrary() failed with 0x%lx\", GetLastError());");
Expand Down

0 comments on commit b3bda85

Please sign in to comment.