Skip to content

Commit

Permalink
fwd: Update __MCF_MAY_THROW to use __MCF_CXX()
Browse files Browse the repository at this point in the history
(cherry picked from commit 140ef0e)
Signed-off-by: LIU Hao <lh_mouse@126.com>
  • Loading branch information
lhmouse committed Nov 2, 2024
1 parent d8d2ad1 commit fdc1629
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mcfgthread/fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@
# define __MCF_UNREACHABLE __assume(0)
#endif

#if defined _MSC_VER && defined __cplusplus
# define __MCF_MAY_THROW throw(...)
/* Generally speaking, functions are either `__MCF_MAY_THROW` or `noexcept`. This
* macro is necessary for Visual Studio (but not CL.EXE from command-line), which
* defaults to `/EHsc`, which assumes that `extern "C"` functions can't throw C++
* exceptions. Not only is this behavior not conforming to the C++ standard, it
* can also result in wrong code about `__MCF_gthr_call_once_seh()`. */
#if defined _MSC_VER
# define __MCF_MAY_THROW __MCF_CXX(throw(...))
#else
# define __MCF_MAY_THROW
#endif
Expand Down

0 comments on commit fdc1629

Please sign in to comment.