Look for correct filename extension when loading native DLLs.

This commit is contained in:
Ryan C. Gordon 2005-12-05 01:11:41 +00:00
parent 24209ecec6
commit cfdd586ef8
2 changed files with 17 additions and 1 deletions

View file

@ -89,6 +89,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define Q3_LITTLE_ENDIAN #define Q3_LITTLE_ENDIAN
#define DLL_EXT ".dll"
#endif #endif
//============================================================== MAC OS X === //============================================================== MAC OS X ===
@ -112,6 +114,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define Q3_LITTLE_ENDIAN #define Q3_LITTLE_ENDIAN
#endif #endif
#define DLL_EXT ".dylib"
#endif #endif
//================================================================= LINUX === //================================================================= LINUX ===
@ -158,6 +162,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define Q3_LITTLE_ENDIAN #define Q3_LITTLE_ENDIAN
#endif #endif
#define DLL_EXT ".so"
#endif #endif
//=============================================================== FreeBSD === //=============================================================== FreeBSD ===
@ -182,6 +188,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define Q3_LITTLE_ENDIAN #define Q3_LITTLE_ENDIAN
#endif #endif
#define DLL_EXT ".so"
#endif #endif
//================================================================= SUNOS === //================================================================= SUNOS ===
@ -207,6 +215,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define Q3_LITTLE_ENDIAN #define Q3_LITTLE_ENDIAN
#endif #endif
#define DLL_EXT ".so"
#endif #endif
//================================================================== Q3VM === //================================================================== Q3VM ===
@ -219,6 +229,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define ARCH_STRING "bytecode" #define ARCH_STRING "bytecode"
#define DLL_EXT ".qvm"
#endif #endif
//=========================================================================== //===========================================================================
@ -240,6 +252,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#error "PATH_SEP not defined" #error "PATH_SEP not defined"
#endif #endif
#ifndef DLL_EXT
#error "DLL_EXT not defined"
#endif
//endianness //endianness
short ShortSwap (short l); short ShortSwap (short l);

View file

@ -800,7 +800,7 @@ void *Sys_LoadDll( const char *name, char *fqpath ,
assert( name ); assert( name );
getcwd(curpath, sizeof(curpath)); getcwd(curpath, sizeof(curpath));
snprintf (fname, sizeof(fname), "%s" ARCH_STRING ".so", name); snprintf (fname, sizeof(fname), "%s" ARCH_STRING DLL_EXT, name);
// TODO: use fs_searchpaths from files.c // TODO: use fs_searchpaths from files.c
pwdpath = Sys_Cwd(); pwdpath = Sys_Cwd();