diff --git a/src/native/common/devil/extil.c b/src/native/common/devil/extil.c index 3e26ba0c..7e5edad5 100644 --- a/src/native/common/devil/extil.c +++ b/src/native/common/devil/extil.c @@ -5,10 +5,9 @@ #else #include #include "extil.h" - #include static void* devILhandle; #endif -#include "org_lwjgl_devil_ILNative.h"; +#include "org_lwjgl_devil_ILNative.h" /* * Class: org_lwjgl_devil_ILNative @@ -68,7 +67,7 @@ bool extil_Open(JNIEnv *env, jobjectArray ilPaths) { printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 devILhandle = LoadLibrary(path_str); -#else +#elif __APPLE__ && __MACH__ char* directoryName = dirname(path_str); char* fileName = basename(path_str); char* currentDirectory = getwd(NULL); @@ -77,13 +76,18 @@ bool extil_Open(JNIEnv *env, jobjectArray ilPaths) { } devILhandle = dlopen(fileName, RTLD_LAZY); if(devILhandle == NULL) { - printfDebug("dlopen failure: %s\n\n\n", dlerror()); + printfDebug("dlopen failure: %s\n", dlerror()); } chdir(currentDirectory); free(currentDirectory); +#else + devILhandle = dlopen(path_str, RTLD_LAZY); + if(devILhandle == NULL) { + printfDebug("dlopen failure: %s\n", dlerror()); + } #endif if (devILhandle != NULL) { - printfDebug("Found devil at '%s'\n", path_str); + printfDebug("Found IL at '%s'\n", path_str); } free(path_str); diff --git a/src/native/common/devil/extilu.c b/src/native/common/devil/extilu.c index e57913f9..31a68c64 100644 --- a/src/native/common/devil/extilu.c +++ b/src/native/common/devil/extilu.c @@ -5,7 +5,6 @@ #else #include #include "extilu.h" - #include static void* devILUhandle; #endif @@ -58,7 +57,7 @@ bool extilu_Open(JNIEnv *env, jobjectArray ilPaths) { printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 devILUhandle = LoadLibrary(path_str); -#else +#elif __APPLE__ && __MACH__ char* directoryName = dirname(path_str); char* fileName = basename(path_str); char* currentDirectory = getwd(NULL); @@ -67,13 +66,18 @@ bool extilu_Open(JNIEnv *env, jobjectArray ilPaths) { } devILUhandle = dlopen(fileName, RTLD_LAZY); if(devILUhandle == NULL) { - printfDebug("dlopen failure: %s\n\n\n", dlerror()); + printfDebug("dlopen failure: %s\n", dlerror()); } chdir(currentDirectory); free(currentDirectory); +#else + devILUhandle = dlopen(path_str, RTLD_LAZY); + if(devILUhandle == NULL) { + printfDebug("dlopen failure: %s\n", dlerror()); + } #endif if (devILUhandle != NULL) { - printfDebug("Found ilu at '%s'\n", path_str); + printfDebug("Found ILU at '%s'\n", path_str); } free(path_str); diff --git a/src/native/common/devil/extilut.c b/src/native/common/devil/extilut.c index c2d604b7..7df964b3 100644 --- a/src/native/common/devil/extilut.c +++ b/src/native/common/devil/extilut.c @@ -5,7 +5,6 @@ #else #include #include "extilut.h" - #include static void* devILUThandle; #endif @@ -58,7 +57,7 @@ bool extilut_Open(JNIEnv *env, jobjectArray ilPaths) { printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 devILUThandle = LoadLibrary(path_str); -#else +#elif __APPLE__ && __MACH__ char* directoryName = dirname(path_str); char* fileName = basename(path_str); char* currentDirectory = getwd(NULL); @@ -67,13 +66,18 @@ bool extilut_Open(JNIEnv *env, jobjectArray ilPaths) { } devILUThandle = dlopen(fileName, RTLD_LAZY); if(devILUThandle == NULL) { - printfDebug("dlopen failure: %s\n\n\n", dlerror()); + printfDebug("dlopen failure: %s\n", dlerror()); } chdir(currentDirectory); free(currentDirectory); +#else + devILUThandle = dlopen(path_str, RTLD_LAZY); + if(devILUThandle == NULL) { + printfDebug("dlopen failure: %s\n", dlerror()); + } #endif if (devILUThandle != NULL) { - printfDebug("Found ilut at '%s'\n", path_str); + printfDebug("Found ILUT at '%s'\n", path_str); } free(path_str);