io: use appropriate string types for windows

This commit is contained in:
Danny Robson 2014-12-05 13:20:44 +11:00
parent 331ea58ec4
commit b8ba95f365

4
io.cpp
View File

@ -122,7 +122,9 @@ fd_ref::fd_ref (int _fd):
fd_ref::fd_ref (const boost::filesystem::path &path, access_t access): fd_ref::fd_ref (const boost::filesystem::path &path, access_t access):
#ifdef PLATFORM_WIN32 #ifdef PLATFORM_WIN32
fd (open (path.native ().c_str (), access_to_cflags (access) | O_BINARY)) // Windows requires the use of 'string ()' to convert to char datatype
// rather than the typical wchar
fd (open (path.string ().c_str (), access_to_cflags (access) | O_BINARY))
#else #else
fd (open (path.native ().c_str (), access_to_cflags (access))) fd (open (path.native ().c_str (), access_to_cflags (access)))
#endif #endif