mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-05 21:57:20 +00:00
Fix file_handle.cpp compilation error on Unix-like systems
This commit is contained in:
parent
43b2be4f0d
commit
4b88e90dc6
@ -16,6 +16,8 @@
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
@ -48,9 +50,9 @@ FileHandle open_file_with_exception(const string& filename, const string& mode)
|
||||
int open_file_descriptor_with_exception(const string& filename, const string& mode)
|
||||
{
|
||||
int flags = 0;
|
||||
if (mode.find('r') != string::npos) flags |= _O_RDONLY;
|
||||
if (mode.find('w') != string::npos) flags |= _O_WRONLY | _O_TRUNC;
|
||||
if (mode.find('b') != string::npos) flags |= _O_BINARY;
|
||||
if (mode.find('r') != string::npos) flags |= O_RDONLY;
|
||||
if (mode.find('w') != string::npos) flags |= O_WRONLY | O_TRUNC;
|
||||
if (mode.find('b') != string::npos) flags |= O_BINARY;
|
||||
|
||||
int fd;
|
||||
#ifdef WIN32
|
||||
|
Loading…
Reference in New Issue
Block a user