1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 15:15:31 +00:00

Updated to work with latest changes upstream

This commit is contained in:
Ardekantur 2010-06-03 19:40:23 -04:00
parent 1004ab7ea2
commit a803c32733
4 changed files with 23 additions and 7 deletions

View file

@ -25,7 +25,7 @@ endif (WIN32)
find_package(OGRE REQUIRED) find_package(OGRE REQUIRED)
find_package(BOOST REQUIRED) find_package(BOOST REQUIRED)
include_directories("." ${OGRE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${PLATFORM_INCLUDE_DIR}) include_directories("." ${OGRE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${PLATFORM_INCLUDE_DIR})
link_directories(${OGRE_LIB_DIR}) link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR})
# Main executable # Main executable
add_executable(openmw ${BSA} ${TOOLS} ${OGRE} ${GAME}) add_executable(openmw ${BSA} ${TOOLS} ${OGRE} ${GAME})

View file

@ -14,12 +14,16 @@
#include "../mangle/tools/str_exception.hpp" #include "../mangle/tools/str_exception.hpp"
#include "../tools/stringops.hpp" #include "../tools/stringops.hpp"
#ifdef __APPLE__
// need our own implementation of strnlen
static size_t strnlen(const char *s, size_t n) static size_t strnlen(const char *s, size_t n)
{ {
const char *p = (const char *)memchr(s, 0, n); const char *p = (const char *)memchr(s, 0, n);
return(p ? p-s : n); return(p ? p-s : n);
} }
#endif
namespace ESM { namespace ESM {
enum Version enum Version

View file

@ -1,7 +1,7 @@
# Defines plugins to load # Defines plugins to load
# Define plugin folder # Define plugin folder
PluginFolder=/usr/local/lib/OGRE PluginFolder=/usr/local/lib/OGRE/
# Define plugins # Define plugins
Plugin=RenderSystem_GL Plugin=RenderSystem_GL

View file

@ -11,10 +11,7 @@ bool isFile(const char *name)
return (stat != 0xFFFFFFFF && return (stat != 0xFFFFFFFF &&
(stat & FILE_ATTRIBUTE_DIRECTORY) == 0); (stat & FILE_ATTRIBUTE_DIRECTORY) == 0);
} }
#endif // _WIN32 #elif __linux__ // Linux implementations
// Linux implementations
#ifdef __linux__
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
@ -29,4 +26,19 @@ bool isFile(const char *name)
if(stat(name, &st)) return false; if(stat(name, &st)) return false;
return S_ISREG(st.st_mode); return S_ISREG(st.st_mode);
} }
#endif // __linux__
#elif __APPLE__ // Darwin implementations
#include <sys/stat.h>
#include <unistd.h>
bool isFile(const char *name)
{
// Does the file exist?
if(access(name,0) != 0)
return false;
struct stat st;
if(stat(name, &st)) return false;
return S_ISREG(st.st_mode);
}
#endif