Added OS X filesystem-support

This commit is contained in:
Jack Andersen 2015-04-04 14:35:32 -10:00
parent 504854f433
commit b21441cc11
5 changed files with 48 additions and 3 deletions

View File

@ -1,8 +1,11 @@
!contains(ATHENA_PRO, true): { !contains(ATHENA_PRO, true): {
INCLUDEPATH += $$PWD/include INCLUDEPATH += $$PWD/include
mac:INCLUDEPATH += /usr/local/include
unix:LIBS += -lz -llzo2 unix:LIBS += -lz -llzo2
win32:LIBS += -lz -llzo2 win32:LIBS += -lz -llzo2
mac:LIBS += -L/usr/local/lib -lz -llzo2
QMAKE_CXXFLAGS += -std=c++11 QMAKE_CXXFLAGS += -std=c++11
mac:QMAKE_CXXFLAGS += -stdlib=libc++
} }
ATHENA_CORE=true ATHENA_CORE=true
@ -21,7 +24,12 @@ SOURCES += \
$$PWD/src/LZ77/LZType11.cpp \ $$PWD/src/LZ77/LZType11.cpp \
$$PWD/src/LZ77/LZBase.cpp $$PWD/src/LZ77/LZBase.cpp
win32:SOURCES += $$PWD/src/win32_largefilewrapper.c win32:SOURCES += \
$$PWD/src/win32_largefilewrapper.c
mac:SOURCES += \
$$PWD/src/osx_largefilewrapper.c
HEADERS += \ HEADERS += \
$$PWD/include/Athena/IStream.hpp \ $$PWD/include/Athena/IStream.hpp \
@ -53,3 +61,7 @@ HEADERS += \
win32:HEADERS += \ win32:HEADERS += \
$$PWD/include/win32_largefilewrapper.h $$PWD/include/win32_largefilewrapper.h
mac:HEADERS += \
$$PWD/include/osx_largefilewrapper.h

View File

@ -0,0 +1,16 @@
#ifndef OSX_LARGEFILEWRAPPER_H
#define OSX_LARGEFILEWRAPPER_H
#if defined(__APPLE__)
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
int fseeko64(FILE* fp, off_t offset, int whence);
off_t ftello64(FILE* fp);
#ifdef __cplusplus
}
#endif
#endif
#endif // OSX_LARGEFILEWRAPPER_H

View File

@ -20,8 +20,10 @@
#include "Athena/IOException.hpp" #include "Athena/IOException.hpp"
#include "utf8.h" #include "utf8.h"
#ifdef _WIN32 #if _WIN32
#include "win32_largefilewrapper.h" #include "win32_largefilewrapper.h"
#elif __APPLE__
#include "osx_largefilewrapper.h"
#endif #endif
namespace Athena namespace Athena

View File

@ -19,8 +19,10 @@
#include "Athena/InvalidOperationException.hpp" #include "Athena/InvalidOperationException.hpp"
#include "Athena/IOException.hpp" #include "Athena/IOException.hpp"
#ifdef _MSC_VER #if _WIN32
#include "win32_largefilewrapper.h" #include "win32_largefilewrapper.h"
#elif __APPLE__
#include "osx_largefilewrapper.h"
#endif #endif
#include "utf8.h" #include "utf8.h"

View File

@ -0,0 +1,13 @@
#include "osx_largefilewrapper.h"
#include <stdio.h>
int fseeko64(FILE* fp, off_t offset, int whence)
{
return fseeko(fp, offset, whence);
}
off_t ftello64(FILE* fp)
{
return ftello(fp);
}