From 2249c0d56a8374d4fb078b4a4562f45982b1a1e9 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 2 Aug 2024 09:48:04 -0700 Subject: [PATCH] Attempt to work around MSVC apparent preprocessor bug. It complains about SOME_MACRO(wrong_number_of_arguments) even if that text is discarded and thus never expanded. --- include/adobe/contract_checks.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/adobe/contract_checks.hpp b/include/adobe/contract_checks.hpp index c9484bc..2bdf139 100644 --- a/include/adobe/contract_checks.hpp +++ b/include/adobe/contract_checks.hpp @@ -169,9 +169,9 @@ class contract_violation final : public ::std::logic_error // // Expands to a statement that reports a precondition failure (and // if supplied) when 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.