AuroraOpenALSoft/common/alfstream.cpp
Chris Robinson 090cf39b17 Use ifstream's wchar_t constructors on Windows
MinGW seems to have added them a while ago, so that greatly simplifies things.
2022-09-12 22:50:43 -07:00

27 lines
461 B
C++

#include "config.h"
#include "alfstream.h"
#include "strutils.h"
#ifdef _WIN32
namespace al {
ifstream::ifstream(const char *filename, std::ios_base::openmode mode)
: std::ifstream{utf8_to_wstr(filename).c_str(), mode}
{ }
void ifstream::open(const char *filename, std::ios_base::openmode mode)
{
std::wstring wstr{utf8_to_wstr(filename)};
std::ifstream::open(wstr.c_str(), mode);
}
ifstream::~ifstream() = default;
} // namespace al
#endif