Skip to content

Commit

Permalink
Attempt to work around MSVC apparent preprocessor bug.
Browse files Browse the repository at this point in the history
It complains about SOME_MACRO(wrong_number_of_arguments) even if that
text is discarded and thus never expanded.
  • Loading branch information
dabrahams committed Aug 2, 2024
1 parent b9c7513 commit 2249c0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/adobe/contract_checks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ class contract_violation final : public ::std::logic_error
//
// Expands to a statement that reports a precondition failure (and
// <message> if supplied) when <condition> is false.
#define ADOBE_PRECONDITION(...) \
ADOBE_THIRD_ARGUMENT( \
__VA_ARGS__, ADOBE_PRECONDITION_2(__VA_ARGS__), ADOBE_PRECONDITION_1(__VA_ARGS__), ignored)
#define ADOBE_PRECONDITION(...) \
ADOBE_THIRD_ARGUMENT(__VA_ARGS__, ADOBE_PRECONDITION_2, ADOBE_PRECONDITION_1, ignored) \
(__VA_ARGS__)

// Expands to a statement that reports a precondition failure when
// condition is false.
Expand Down

0 comments on commit 2249c0d

Please sign in to comment.