First post, by superfury
I'm trying to get my 64-bit file I/O in UniPCemu to be cross-platform completely. The reads and writes to files have no complications(since they use the internal number to keep track of the current file position), but _fseeki64 and _ftelli64 seems to have problems with e.g. MinGW builds?
#if defined(VISUALC) || (defined(_fseeki64) && defined(_ftelli64))
if (!(result = _fseeki64(b->f, pos, direction))) //Direction is constant itself!
{
b->position = _ftelli64(b->f); //Use our own position indicator!
}
#elif defined(fseeki64) && defined(ftelli64)
if (!(result = fseeki64(b->f, pos, direction))) //Direction is constant itself!
{
b->position = ftelli64(b->f); //Use our own position indicator!
}
#elif defined(_fseeko64) && defined(_ftello64)
if (!(result = _fseeko64(b->f, pos, direction))) //Direction is constant itself!
{
b->position = _ftello64(b->f); //Use our own position indicator!
}
#elif defined(fseeko64) && defined(ftello64)
if (!(result = fseeko64(b->f, pos, direction))) //Direction is constant itself!
{
b->position = ftello64(b->f); //Use our own position indicator!
}
#elif defined(_fseeko) && defined(_ftello)
if (!(result = _fseeko(b->f, pos, direction))) //Direction is constant itself!
{
b->position = _ftello(b->f); //Use our own position indicator!
}
#elif defined(fseeko) && defined(ftello)
if (!(result = fseeko(b->f, pos, direction))) //Direction is constant itself!
{
b->position = ftello(b->f); //Use our own position indicator!
}
#else
if (!(result = fseek(b->f, pos, direction))) //Direction is constant itself!
{
b->position = ftell(b->f); //Use our own position indicator!
}
#endif
For some reason, it ends up at the normal fseek and ftell when using MinGW?
Anyone?
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io