@@ -18,16 +18,9 @@ Author: Daniel Kroening, kroening@kroening.com
1818#include < util/options.h>
1919#include < util/string2int.h>
2020#include < util/string_utils.h>
21+ #include < util/unicode.h>
2122#include < util/version.h>
2223
23- #include < fstream> // IWYU pragma: keep
24- #include < iostream>
25- #include < memory>
26-
27- #ifdef _MSC_VER
28- # include < util/unicode.h>
29- #endif
30-
3124#include < goto-programs/class_hierarchy.h>
3225#include < goto-programs/ensure_one_backedge_per_target.h>
3326#include < goto-programs/goto_check.h>
@@ -109,6 +102,10 @@ Author: Daniel Kroening, kroening@kroening.com
109102#include " unwind.h"
110103#include " value_set_fi_fp_removal.h"
111104
105+ #include < fstream> // IWYU pragma: keep
106+ #include < iostream>
107+ #include < memory>
108+
112109#include " accelerate/accelerate.h"
113110
114111// / invoke main modules
@@ -248,11 +245,8 @@ int goto_instrument_parse_optionst::doit()
248245
249246 if (have_file)
250247 {
251- #ifdef _MSC_VER
252- std::ofstream of (widen (filename));
253- #else
254- std::ofstream of (filename);
255- #endif
248+ std::ofstream of (widen_if_needed (filename));
249+
256250 if (!of)
257251 throw " failed to open file " +filename;
258252
@@ -745,11 +739,8 @@ int goto_instrument_parse_optionst::doit()
745739
746740 if (cmdline.args .size ()==2 )
747741 {
748- #ifdef _MSC_VER
749- std::ofstream out (widen (cmdline.args [1 ]));
750- #else
751- std::ofstream out (cmdline.args [1 ]);
752- #endif
742+ std::ofstream out (widen_if_needed (cmdline.args [1 ]));
743+
753744 if (!out)
754745 {
755746 log.error () << " failed to write to '" << cmdline.args [1 ] << " '" ;
@@ -844,11 +835,8 @@ int goto_instrument_parse_optionst::doit()
844835
845836 if (cmdline.args .size ()==2 )
846837 {
847- #ifdef _MSC_VER
848- std::ofstream out (widen (cmdline.args [1 ]));
849- #else
850- std::ofstream out (cmdline.args [1 ]);
851- #endif
838+ std::ofstream out (widen_if_needed (cmdline.args [1 ]));
839+
852840 if (!out)
853841 {
854842 log.error () << " failed to write to " << cmdline.args [1 ] << " '" ;
@@ -891,11 +879,7 @@ int goto_instrument_parse_optionst::doit()
891879
892880 if (cmdline.args .size ()==2 )
893881 {
894- #ifdef _MSC_VER
895- std::ofstream out (widen (cmdline.args [1 ]));
896- #else
897- std::ofstream out (cmdline.args [1 ]);
898- #endif
882+ std::ofstream out (widen_if_needed (cmdline.args [1 ]));
899883
900884 if (!out)
901885 {
@@ -1338,11 +1322,8 @@ void goto_instrument_parse_optionst::instrument_goto_program()
13381322
13391323 if (have_file)
13401324 {
1341- #ifdef _MSC_VER
1342- std::ofstream of (widen (filename));
1343- #else
1344- std::ofstream of (filename);
1345- #endif
1325+ std::ofstream of (widen_if_needed (filename));
1326+
13461327 if (!of)
13471328 throw " failed to open file " +filename;
13481329
0 commit comments