@@ -85,7 +85,7 @@ open(char const* path, file_mode mode,
8585 f_ = nullptr ;
8686 }
8787 ec = {};
88- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
88+ #ifdef _WIN32
8989 boost::winapi::WCHAR_ const * s;
9090 detail::win32_unicode_path unicode_path (path, ec);
9191 if (ec)
@@ -97,23 +97,23 @@ open(char const* path, file_mode mode,
9797 {
9898 default :
9999 case file_mode::read:
100- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
100+ #ifdef _WIN32
101101 s = L" rb" ;
102102 #else
103103 s = " rb" ;
104104 #endif
105105 break ;
106106
107107 case file_mode::scan:
108- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
108+ #ifdef _WIN32
109109 s = L" rbS" ;
110110 #else
111111 s = " rb" ;
112112 #endif
113113 break ;
114114
115115 case file_mode::write:
116- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
116+ #ifdef _WIN32
117117 s = L" wb+" ;
118118 #else
119119 s = " wb+" ;
@@ -122,7 +122,7 @@ open(char const* path, file_mode mode,
122122
123123 case file_mode::write_new:
124124 {
125- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
125+ #ifdef _WIN32
126126# if (defined(BOOST_MSVC) && BOOST_MSVC >= 1910) || (defined(_MSVC_STL_VERSION) && _MSVC_STL_VERSION >= 141)
127127 s = L" wbx" ;
128128# else
@@ -151,15 +151,15 @@ open(char const* path, file_mode mode,
151151 }
152152
153153 case file_mode::write_existing:
154- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
154+ #ifdef _WIN32
155155 s = L" rb+" ;
156156 #else
157157 s = " rb+" ;
158158 #endif
159159 break ;
160160
161161 case file_mode::append:
162- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
162+ #ifdef _WIN32
163163 s = L" ab" ;
164164 #else
165165 s = " ab" ;
@@ -168,7 +168,7 @@ open(char const* path, file_mode mode,
168168
169169 case file_mode::append_existing:
170170 {
171- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
171+ #ifdef _WIN32
172172 std::FILE* f0;
173173 auto const ev =
174174 ::_wfopen_s (&f0, unicode_path.c_str(), L"rb+");
@@ -189,7 +189,7 @@ open(char const* path, file_mode mode,
189189 }
190190#endif
191191 std::fclose (f0);
192- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
192+ #ifdef _WIN32
193193 s = L" ab" ;
194194 #else
195195 s = " ab" ;
@@ -198,7 +198,7 @@ open(char const* path, file_mode mode,
198198 }
199199 }
200200
201- #if defined(BOOST_MSVC) || defined(_MSVC_STL_VERSION)
201+ #ifdef _WIN32
202202 auto const ev = ::_wfopen_s (
203203 &f_, unicode_path.c_str (), s);
204204 if (ev)
0 commit comments