mirror of
https://github.com/libAthena/athena.git
synced 2025-12-09 13:38:03 +00:00
* Add windows specific wrappers
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
#include "Athena/IOException.hpp"
|
||||
#include "utf8.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "win32_largefilewrapper.h"
|
||||
#endif
|
||||
|
||||
namespace Athena
|
||||
{
|
||||
namespace io
|
||||
|
||||
14
src/win32_largefilewrapper.c
Normal file
14
src/win32_largefilewrapper.c
Normal 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
|
||||
Reference in New Issue
Block a user