|
From: <ma...@us...> - 2006-12-04 21:58:49
|
Revision: 2687
http://svn.sourceforge.net/java-game-lib/?rev=2687&view=rev
Author: matzon
Date: 2006-12-04 13:58:46 -0800 (Mon, 04 Dec 2006)
Log Message:
-----------
fix loading issues on linux/mac
Modified Paths:
--------------
trunk/LWJGL/src/native/common/devil/extil.c
trunk/LWJGL/src/native/common/devil/extilu.c
trunk/LWJGL/src/native/common/devil/extilut.c
Modified: trunk/LWJGL/src/native/common/devil/extil.c
===================================================================
--- trunk/LWJGL/src/native/common/devil/extil.c 2006-12-02 22:21:32 UTC (rev 2686)
+++ trunk/LWJGL/src/native/common/devil/extil.c 2006-12-04 21:58:46 UTC (rev 2687)
@@ -5,10 +5,9 @@
#else
#include <dlfcn.h>
#include "extil.h"
- #include <libgen.h>
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 @@
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 @@
}
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);
Modified: trunk/LWJGL/src/native/common/devil/extilu.c
===================================================================
--- trunk/LWJGL/src/native/common/devil/extilu.c 2006-12-02 22:21:32 UTC (rev 2686)
+++ trunk/LWJGL/src/native/common/devil/extilu.c 2006-12-04 21:58:46 UTC (rev 2687)
@@ -5,7 +5,6 @@
#else
#include <dlfcn.h>
#include "extilu.h"
- #include <libgen.h>
static void* devILUhandle;
#endif
@@ -58,7 +57,7 @@
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 @@
}
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);
Modified: trunk/LWJGL/src/native/common/devil/extilut.c
===================================================================
--- trunk/LWJGL/src/native/common/devil/extilut.c 2006-12-02 22:21:32 UTC (rev 2686)
+++ trunk/LWJGL/src/native/common/devil/extilut.c 2006-12-04 21:58:46 UTC (rev 2687)
@@ -5,7 +5,6 @@
#else
#include <dlfcn.h>
#include "extilut.h"
- #include <libgen.h>
static void* devILUThandle;
#endif
@@ -58,7 +57,7 @@
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 @@
}
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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|