use nowide::ofstream on linux

This commit is contained in:
xiaoniu 2023-10-18 19:14:29 +08:00
parent 09fedc15ec
commit e9e25ecc53
2 changed files with 2 additions and 10 deletions

View File

@ -8,16 +8,12 @@
#include <iostream>
#include <sstream>
#include <fstream>
#ifdef _MSC_VER
#include <boost/nowide/fstream.hpp>
#endif
#include "arithmetic.h"
#include "IniParser.h"
#ifdef _MSC_VER
namespace nw = boost::nowide;
#endif
namespace hku {
@ -63,11 +59,7 @@ IniParser::~IniParser() {}
* @param filename
*/
void IniParser::read(const std::string& filename) {
#ifdef _MSC_VER
nw::ifstream inifile(filename.c_str(), nw::ifstream::in);
#else
std::ifstream inifile(filename.c_str(), std::ifstream::in);
#endif
if (!inifile) {
throw(std::invalid_argument("Can't read file(" + filename + ")!"));
}

View File

@ -155,12 +155,12 @@ add_requires("myboost " .. boost_version, {
debug = is_mode("debug"),
configs = {
shared = is_plat("windows") and true or false,
data_time = true,
date_time = true,
filesystem = true,
serialization = true,
system = false,
python = true,
nowide = is_plat("windows") and true or false,
nowide = true,
pyver = get_config("pyver"),
},
})