@@ -119,15 +119,15 @@ int generate_project(const char *str) {
119119 const auto tomlbuf = format (cmake_toml, dir_name.c_str (), dir_name.c_str (), str, installed.c_str (), target.c_str (), dest.c_str ());
120120
121121 if (strcmp (str, " interface" )) {
122- std::ofstream ofs (" src/main.cpp" );
122+ std::ofstream ofs (" src/main.cpp" , std::ios::binary );
123123 if (ofs.is_open ()) {
124124 ofs << mainbuf;
125125 }
126126 ofs.flush ();
127127 ofs.close ();
128128 }
129129
130- std::ofstream ofs2 (" cmake.toml" );
130+ std::ofstream ofs2 (" cmake.toml" , std::ios::binary );
131131 if (ofs2.is_open ()) {
132132 ofs2 << tomlbuf;
133133 }
@@ -607,7 +607,7 @@ int generate_cmake(const char *path, const parser::Project *parent_project) {
607607 j[" description" ] = project.project_description ;
608608 }
609609
610- std::ofstream ofs (" vcpkg.json" );
610+ std::ofstream ofs (" vcpkg.json" , std::ios::binary );
611611 if (!ofs) {
612612 throw std::runtime_error (" Failed to create a vcpkg.json manifest file!" );
613613 }
@@ -900,7 +900,7 @@ int generate_cmake(const char *path, const parser::Project *parent_project) {
900900 if (!fs::exists (list_path))
901901 return true ;
902902
903- std::ifstream ifs (list_path, std::ios_base ::binary);
903+ std::ifstream ifs (list_path, std::ios ::binary);
904904 if (!ifs.is_open ()) {
905905 throw std::runtime_error (" Failed to read " + list_path.string ());
906906 }
@@ -910,7 +910,7 @@ int generate_cmake(const char *path, const parser::Project *parent_project) {
910910 }();
911911
912912 if (should_regenerate) {
913- std::ofstream ofs (list_path, std::ios_base ::binary);
913+ std::ofstream ofs (list_path, std::ios ::binary);
914914 if (ofs.is_open ()) {
915915 ofs << ss.str ();
916916 } else {
0 commit comments