From 11472e8be9dc3499cd7b82eb263e02035489b6ce Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Tue, 11 Apr 2023 17:27:34 +0300 Subject: [PATCH] Fix soundOpenData flags --- src/sound.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sound.cc b/src/sound.cc index 5b6114b..0576358 100644 --- a/src/sound.cc +++ b/src/sound.cc @@ -225,7 +225,15 @@ static int soundReadData(int fileHandle, void* buf, unsigned int size) // 0x4AC768 static int soundOpenData(const char* filePath, int* channels, int* sampleRate) { - return open(filePath, _O_RDONLY | _O_BINARY); + int flags; + +#ifdef _WIN32 + flags = _O_RDONLY | _O_BINARY; +#else + flags = O_RDONLY; +#endif + + return open(filePath, flags); } // 0x4AC774