From a6404a8fb25d007baec912df3917b177e388fe3c Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Tue, 12 Nov 2019 14:57:09 -0500 Subject: [PATCH] Fixed __VA_OPT__ functionality for vc++ in c20 mode. --- include/boost/preprocessor/variadic/detail/has_opt.hpp | 9 +++++++++ include/boost/preprocessor/variadic/has_opt.hpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/boost/preprocessor/variadic/detail/has_opt.hpp b/include/boost/preprocessor/variadic/detail/has_opt.hpp index 11b6552..79edf3b 100644 --- a/include/boost/preprocessor/variadic/detail/has_opt.hpp +++ b/include/boost/preprocessor/variadic/detail/has_opt.hpp @@ -16,12 +16,21 @@ # # if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L # +# if BOOST_PP_VARIADICS_MSVC +# include +# endif +# # define BOOST_PP_VARIADIC_HAS_OPT_FUNCTION(...) \ __VA_OPT__(,) , 1, 0 \ /**/ # +# if BOOST_PP_VARIADICS_MSVC +# define BOOST_PP_VARIADIC_HAS_OPT_ELEM0(e0, ...) BOOST_PP_CAT(BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0,__VA_ARGS__),) +# define BOOST_PP_VARIADIC_HAS_OPT_ELEM2(e0, ...) BOOST_PP_CAT(BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0,__VA_ARGS__),) +# else # define BOOST_PP_VARIADIC_HAS_OPT_ELEM0(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0,__VA_ARGS__) # define BOOST_PP_VARIADIC_HAS_OPT_ELEM2(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0,__VA_ARGS__) +# endif # define BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0, ...) e0 # define BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0, e1, e2, ...) e2 # diff --git a/include/boost/preprocessor/variadic/has_opt.hpp b/include/boost/preprocessor/variadic/has_opt.hpp index 4e5035e..3ab0890 100644 --- a/include/boost/preprocessor/variadic/has_opt.hpp +++ b/include/boost/preprocessor/variadic/has_opt.hpp @@ -16,7 +16,7 @@ # # /* BOOST_PP_VARIADIC_HAS_OPT */ # -# if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L && !BOOST_PP_VARIADICS_MSVC +# if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L # include # define BOOST_PP_VARIADIC_HAS_OPT() \ BOOST_PP_VARIADIC_HAS_OPT_ELEM2(BOOST_PP_VARIADIC_HAS_OPT_FUNCTION(?),) \