Skip to content

Commit

Permalink
Potential fixes for issue #747
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Mar 11, 2024
1 parent 9940c31 commit e824acf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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 e824acf

Please sign in to comment.