Skip to content

Commit

Permalink
Fix windows optional_throw
Browse files Browse the repository at this point in the history
  • Loading branch information
emilydolson committed Nov 26, 2023
1 parent 2412737 commit f0d9d42
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/emp/base/optional_throw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@

#if defined (_MSC_VER )

#define emp_optional_throw(TEST, MESSAGE) \
#define emp_optional_throw_mscv_impl(TEST, MESSAGE) \
do { \
if (!(TEST)) { \
emp::assert_throw(__FILE__, __LINE__, #TEST, #MESSAGE, 0); \
} \
} while(0)

#define emp_optional_throw_impl(TEST, MESSAGE) emp_optional_throw_mscv_impl(TEST, MESSAGE)

#else

#define emp_optional_throw(...) \
#define emp_optional_throw_impl(...) \
do { \
if (!(emp_assert_GET_ARG_1(__VA_ARGS__, ~))) { \
emp::assert_throw( \
Expand All @@ -46,6 +48,8 @@

#endif

#define emp_optional_throw(...) emp_optional_throw_impl(__VA_ARGS__)

#elif defined( EMP_NDEBUG )

#define emp_optional_throw(...)
Expand Down

0 comments on commit f0d9d42

Please sign in to comment.