File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
fast_io_freestanding_impl/io_buffer Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1
1
// Please keep it in reverse order with the macros in push_macros.h
2
2
3
+ #pragma pop_macro("FAST_IO_CPP_EXCEPTIONS")
3
4
#pragma pop_macro("FAST_IO_HAS_BUILTIN")
4
5
#pragma pop_macro("FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE")
5
6
#pragma pop_macro("FAST_IO_ASSERT")
Original file line number Diff line number Diff line change @@ -220,7 +220,19 @@ Internal assert macros for fuzzing fast_io.
220
220
#pragma push_macro("FAST_IO_HAS_BUILTIN")
221
221
#undef FAST_IO_HAS_BUILTIN
222
222
#ifdef __has_builtin
223
- # define FAST_IO_HAS_BUILTIN (...) __has_builtin(__VA_ARGS__)
223
+ #define FAST_IO_HAS_BUILTIN (...) __has_builtin(__VA_ARGS__)
224
224
#else
225
- # define FAST_IO_HAS_BUILTIN (...) 0
225
+ #define FAST_IO_HAS_BUILTIN (...) 0
226
+ #endif
227
+
228
+ #pragma push_macro("FAST_IO_CPP_EXCEPTIONS")
229
+ #undef FAST_IO_CPP_EXCEPTIONS
230
+ #if defined (_MSC_VER) && !defined(__clang__)
231
+ #if defined(_CPPUNWIND)
232
+ #define FAST_IO_CPP_EXCEPTIONS
233
+ #endif
234
+ #else
235
+ #if __cpp_exceptions >= 199711L
236
+ #define FAST_IO_CPP_EXCEPTIONS
237
+ #endif
226
238
#endif
Original file line number Diff line number Diff line change @@ -37,13 +37,13 @@ inline constexpr void destroy_basic_io_buffer(T &t) noexcept
37
37
constexpr auto mode{traits_type::mode};
38
38
if constexpr ((mode & buffer_mode::out) == buffer_mode::out)
39
39
{
40
- #if __cpp_exceptions >= 199711L
40
+ #ifdef FAST_IO_CPP_EXCEPTIONS
41
41
try
42
- #endif
43
42
{
43
+ #endif
44
44
::fast_io::details::close_basic_io_buffer (t);
45
+ #ifdef FAST_IO_CPP_EXCEPTIONS
45
46
}
46
- #if __cpp_exceptions >= 199711L
47
47
catch (...)
48
48
{
49
49
}
You can’t perform that action at this time.
0 commit comments