* Add windows specific wrappers

This commit is contained in:
2014-05-14 22:42:20 -07:00
parent c0974d511a
commit a19520ea1e
6 changed files with 43 additions and 9 deletions

View File

@@ -54,11 +54,7 @@ BinaryWriter::BinaryWriter(const std::string& filename, std::function<void(int)>
m_length = 0x10;
m_bitPosition = 0;
m_position = 0;
#ifdef HW_RVL
m_data = (Uint8*)memalign(32, m_length);
#else
m_data = new Uint8[m_length];
#endif
if (!m_data)
THROW_IO_EXCEPTION("Could not allocate memory!");
@@ -159,11 +155,7 @@ std::string BinaryWriter::filepath() const
void BinaryWriter::setData(const Uint8* data, Uint64 length)
{
if (m_data)
#ifdef HW_RVL
free(m_data);
#else
delete[] m_data;
#endif
m_data = (Uint8*)data;
m_length = length;

View File

@@ -20,6 +20,10 @@
#include "Athena/IOException.hpp"
#include "utf8.h"
#ifdef _WIN32
#include "win32_largefilewrapper.h"
#endif
namespace Athena
{
namespace io

View File

@@ -0,0 +1,14 @@
#include "win32_largefilewrapper.h"
#include <stdio.h>
#ifdef _WIN32
int fseeko64(FILE* fp, off64_t offset, int whence)
{
return _fseeki64(fp, offset, whence);
}
int ftello64(FILE* fp)
{
return _ftelli64(fp);
}
#endif