@@ -89,7 +89,7 @@ static bool BaseFile_Create(TFileStream * pStream)
89
89
}
90
90
#endif
91
91
92
- #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
92
+ #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)
93
93
{
94
94
intptr_t handle;
95
95
@@ -138,7 +138,7 @@ static bool BaseFile_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
138
138
}
139
139
#endif
140
140
141
- #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
141
+ #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)
142
142
{
143
143
struct stat64 fileinfo;
144
144
int oflag = (dwStreamFlags & STREAM_FLAG_READ_ONLY) ? O_RDONLY : O_RDWR;
@@ -207,7 +207,7 @@ static bool BaseFile_Read(
207
207
}
208
208
#endif
209
209
210
- #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
210
+ #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)
211
211
{
212
212
ssize_t bytes_read;
213
213
@@ -278,7 +278,7 @@ static bool BaseFile_Write(TFileStream * pStream, ULONGLONG * pByteOffset, const
278
278
}
279
279
#endif
280
280
281
- #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
281
+ #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)
282
282
{
283
283
ssize_t bytes_written;
284
284
@@ -345,7 +345,7 @@ static bool BaseFile_Resize(TFileStream * pStream, ULONGLONG NewFileSize)
345
345
}
346
346
#endif
347
347
348
- #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
348
+ #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)
349
349
{
350
350
if (ftruncate64 ((intptr_t )pStream->Base .File .hFile , (off64_t )NewFileSize) == -1 )
351
351
{
@@ -389,7 +389,7 @@ static bool BaseFile_Replace(TFileStream * pStream, TFileStream * pNewStream)
389
389
return (bool )MoveFile (pNewStream->szFileName , pStream->szFileName );
390
390
#endif
391
391
392
- #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
392
+ #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)
393
393
// "rename" on Linux also works if the target file exists
394
394
if (rename (pNewStream->szFileName , pStream->szFileName ) == -1 )
395
395
{
@@ -409,7 +409,7 @@ static void BaseFile_Close(TFileStream * pStream)
409
409
CloseHandle (pStream->Base .File .hFile );
410
410
#endif
411
411
412
- #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
412
+ #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)
413
413
close ((intptr_t )pStream->Base .File .hFile );
414
414
#endif
415
415
}
@@ -488,7 +488,7 @@ static bool BaseMap_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
488
488
return false ;
489
489
#endif
490
490
491
- #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
491
+ #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)
492
492
struct stat64 fileinfo;
493
493
intptr_t handle;
494
494
bool bResult = false ;
@@ -557,7 +557,7 @@ static void BaseMap_Close(TFileStream * pStream)
557
557
UnmapViewOfFile (pStream->Base .Map .pbFile );
558
558
#endif
559
559
560
- #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
560
+ #if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)
561
561
if (pStream->Base .Map .pbFile != NULL )
562
562
munmap (pStream->Base .Map .pbFile , (size_t )pStream->Base .Map .FileSize );
563
563
#endif
0 commit comments